Share via


Envelope.UpdateDocument メソッド (Word)

現在の封筒の設定に従って文書の封筒を更新します。

構文

UpdateDocument

expression 必須です。 'Envelope' オブジェクトを表す変数。

注釈

文書に封筒を追加する前にこのプロパティを使用すると、エラーが発生します。

次の使用例は、112 × 187mm のサイズの封筒を使用するように Report.doc を設定します。

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

関連項目

Envelope オブジェクト

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。