This example formats the envelope in Report.doc to use a custom envelope size (4.5 inches by 7.5 inches).
On Error GoTo errhandler
With Documents("Report.doc").Envelope
.DefaultHeight = InchesToPoints(4.5)
.DefaultWidth = InchesToPoints(7.5)
.UpdateDocument
End With
errhandler:
If Err = 5852 Then MsgBox "Report.doc doesn't include an envelope"
This example adds an envelope to the active document, using predefined addresses. The default envelope bar code and Facing Identification Mark (FIM-A) settings are set to True, and the envelope in the active document is updated.
addr = "Darlene Rudd" & vbCr & "1234 E. Main St." _
& vbCr & "Our Town, WA 98004"
ret = "Patricia Reed" & vbCr & "N. 33rd St." _
& vbCr & "Other Town, WA 98040"
ActiveDocument.Envelope.Insert Address:=addr, ReturnAddress:=ret
With ActiveDocument.Envelope
.DefaultPrintBarCode = True
.DefaultPrintFIMA = True
.UpdateDocument
End With