Application.EPostageInsertEx イベント (Word)

ユーザーが電子切手を文書に挿入するときに発生します。

構文

EPostageInsertEx( _Doc_ , _cpDeliveryAddrStart_ , _cpDeliveryAddrEnd_ , _cpReturnAddrStart_ , _cpReturnAddrEnd_ , _xaWidth_ , _yaHeight_ , _bstrPrinterName_ , _bstrPaperFeed_ , _fPrint_ , _fCancel_ )

クラス モジュール内のイベントで宣言された 'Application' オブジェクトを表す変数。 Application オブジェクトでイベントを使用する方法については、「 Application オブジェクト でのイベントの使用」を参照してください。

パラメーター

名前 必須 / オプション データ型 説明
Doc 必須 Document 電子切手を追加する文書の名前を指定します。
cpDeliveryAddrStart 必須 長整数型 (Long) 配送先住所にドキュメント内の開始位置。 位置は、 Range オブジェクトの Start プロパティの値に対応します。
cpDeliveryAddrEnd 必須 長整数型 (Long) 配送先住所の文書の終了位置です。 位置は、 Range オブジェクトの End プロパティの値に対応します。
cpReturnAddrStart 必須 長整数型 (Long) 差出人住所用の文書の開始位置。 位置は、 Range オブジェクトの Start プロパティの値に対応します。
cpReturnAddrEnd 必須 長整数型 (Long) 差出人住所用の文書の終了位置です。 位置は、 Range オブジェクトの End プロパティの値に対応します。
xaWidth 必須 長整数型 (Long) 封筒の幅 (1/1440 インチ (1/3658 cm) 単位) になります。
yaHeight 必須 長整数型 (Long) 封筒の高さ (1/1440 インチ (1/3658 cm) 単位) になります。
bstrPrinterName 必須 String [ 封筒オプション] ダイアログ ボックスの [ 印刷オプション] タブで指定されるプリンターの名前です。
bstrPaperFeed 必須 String [ 封筒オプション] ダイアログ ボックスの [ 印刷オプション] タブで指定される給紙方法です。
fPrint 必須 ブール型 (Boolean) True の 場合は、封筒を印刷するのには、ユーザーが指定しました。 False 場合は、ユーザーが指定した文書に封筒を挿入します。
fCancel 必須 ブール型 (Boolean) 電子切手を挿入する 場合は true をキャンセルします。

次の使用例は、ユーザーに対してメッセージを表示します。 ユーザーがメッセージをキャンセルした場合、指定されたアクションはキャンセルされます。

Private Sub App_EPostageInsertEx(ByVal Doc As Document, ByVal cpDeliveryAddrStart As Long, _ 
 ByVal cpDeliveryAddrEnd As Long, ByVal cpReturnAddrStart As Long, _ 
 ByVal cpReturnAddrEnd As Long, ByVal xaWidth As Long, ByVal yaHeight As Long, _ 
 ByVal bstrPrinterName As String, ByVal bstrPaperFeed As String, _ 
 ByVal fPrint As Boolean, fCancel As Boolean) 
 
 Dim intResponse As Integer 
 
 If fPrint = True Then 
 intResponse = MsgBox("Make sure the printer is ready to print an envelope." & vbCrLf & _ 
 "When the printer is ready, click OK.", vbOKCancel) 
 
 If intResponse = vbCancel Then 
 fCancel = True 
 End If 
 End If 
End Sub

関連項目

Application オブジェクト

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

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