Envelope Object

Multiple objects

Represents an envelope. There is no Envelopes collection; each Document object contains only one Envelope object.

Using the Envelope Object

Use the Envelope property to return the Envelope object. The following example adds an envelope to a new document and sets the distance between the top of the envelope and the address to 2.25 inches.

Set myDoc = Documents.Add
addr = "Michael Matey" & vbCr & "123 Skye St." _
    & vbCr & "Redmond, WA 98107"
retaddr = "Cora Edmonds" & vbCr & "456 Erde Lane" & vbCr _
    & "Redmond, WA 98107"
With myDoc.Envelope
    .Insert Address:=addr, ReturnAddress:=retaddr
    .AddressFromTop = InchesToPoints(2.25)
End With


The Envelope object is available regardless of whether an envelope has been added to the specified document. However, an error occurs if you use one of the following properties when an envelope hasn't been added to the document: Address, AddressFromleft, AddressFromTop, FeedSource, ReturnAddress, ReturnAddressFromLeft, ReturnAddressFromTop, and UpdateDocument.

The following example demonstrates how to use the On Error GoTo statement to trap the error that occurs if an envelope hasn't been added to the active document. If, however, an envelope has been added to the document, the recipient address is displayed.

On Error GoTo ErrorHandler
MsgBox ActiveDocument.Envelope.Address
If Err = 5852 Then MsgBox _
    "Envelope is not in the specified document"

Use the Insert method to add an envelope to the specified document. Use the PrintOut method to set the properties of an envelope and print it without adding it to the document.

Properties | Address Property | AddressFromLeft Property | AddressFromTop Property | AddressStyle Property | Application Property | Creator Property | DefaultFaceUp Property | DefaultHeight Property | DefaultOmitReturnAddress Property | DefaultOrientation Property | DefaultPrintBarCode Property | DefaultPrintFIMA Property | DefaultSize Property | DefaultWidth Property | FeedSource Property | Parent Property | RecipientNamefromLeft Property | RecipientNamefromTop Property | RecipientPostalfromLeft Property | RecipientPostalfromTop Property | ReturnAddress Property | ReturnAddressFromLeft Property | ReturnAddressFromTop Property | ReturnAddressStyle Property | SenderNamefromLeft Property | SenderNamefromTop Property | SenderPostalfromLeft Property | SenderPostalfromTop Property | Vertical Property

Methods | Insert Method | Options Method | PrintOut Method | UpdateDocument Method

Parent Objects | Document Object

Child Objects | Range Object | Style Object

See Also | MailingLabel Object