UpdateDocument Method
Applies To
Envelope object.
Description
Updates the envelope in the document with the current envelope settings.
Note If you use this property before an envelope has been added to the document, an error occurs.
Syntax
expression.UpdateDocument
expression Required. An expression that returns an Envelope object.
See Also
Envelope property.
Example
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