Word) (Application.EPostageInsertEx 事件

會在使用者將電子郵資插入文件時發生。

語法

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

表達 變數,表示已使用類別模組中的事件宣告的 'Application' 物件。 如需搭配 Application 物件使用 事件的相關資訊,請 參閱搭配 Application 物件使用事件

參數

名稱 必要/選用 資料類型 描述
Doc 必要 Document 正在新增電子郵資的文件。
cpDeliveryAddrStart 必要 Long 傳遞地址的文件中的起始位置。 位置會對應至 Range 物件的 啟動 屬性的值。
cpDeliveryAddrEnd 必要 Long 文件中的傳遞位址結束字元位置。 位置會對應至 Range 物件的 End 屬性的值。
cpReturnAddrStart 必要 Long 在文件的回覆地址的開始位置。 位置會對應至 Range 物件的 啟動 屬性的值。
cpReturnAddrEnd 必要 Long 在文件的回覆地址的結束字元位置。 位置會對應至 Range 物件的 End 屬性的值。
xaWidth 必要 Long 信封的寬度 (以 1/1440 英吋為單位)。
yaHeight 必要 Long 信封的高度 (以 1/1440 英吋為單位)。
bstrPrinterName 必要 String The name of the printer as specified on the Printing Options tab of the Envelope Options dialog box.
bstrPaperFeed 必要 String The feed method as specified on the Printing Options tab of the Envelope Options dialog box.
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 支援與意見反應