UpdateDocument 方法

       

用当前的信封设置更新文档中的信封。

注意   如果在将信封添至文档前使用此属性将导致出错。

expression.UpdateDocument

expression   必需。该表达式返回一个 Envelope 对象。

示例

本示例将 Report.doc 中的信封设置为自定义信封尺寸(4.5 英寸 x 7.5 英寸)。

Sub UpdateEnvelope()

    On Error GoTo errhandler

    With Documents("Report.doc").Envelope
        .DefaultHeight = InchesToPoints(4.5)
        .DefaultWidth = InchesToPoints(7.5)
        .UpdateDocument
    End With

    Exit Sub

errhandler:

    If Err = 5852 Then _
        MsgBox "Report.doc doesn't include an envelope"

End Sub

本示例用预定义地址将一个信封添加到活动文档。然后将默认的信封条形码和 FIM-A 设置为 True,并更新活动文档中的信封。

Dim strAddress As String
Dim strReturn As String

strAddress = "Darlene Rudd" & vbCr & "1234 E. Main St." _
    & vbCr & "Our Town, WA  98004"
strReturn = "Patricia Reed" & vbCr & "N. 33rd St." _
    & vbCr & "Other Town, WA  98040"
ActiveDocument.Envelope.Insert _
    Address:=strAddress, ReturnAddress:=strReturn
With ActiveDocument.Envelope
    .DefaultPrintBarCode = True
    .DefaultPrintFIMA = True
    .UpdateDocument
End With