当用户在文档中插入电子邮政时发生。
语法
expression。
EPostageInsertEx( _Doc_ , _cpDeliveryAddrStart_ , _cpDeliveryAddrEnd_ , _cpReturnAddrStart_ , _cpReturnAddrEnd_ , _xaWidth_ , _yaHeight_ , _bstrPrinterName_ , _bstrPaperFeed_ , _fPrint_ , _fCancel_ )
表达 一个变量,表示已使用类模块中的事件声明的“Application”对象。 有关对 Application 对象使用事件的信息,请参阅 将事件与 Application 对象配合使用。
参数
| 名称 | 必需/可选 | 数据类型 | 说明 |
|---|---|---|---|
| Doc | 必需 | Document | 要添加电子邮政的文档。 |
| cpDeliveryAddrStart | 必需 | Long | 收信人地址的文档中的起始位置。 定位到一个 Range 对象, 启动 属性的值对应。 |
| cpDeliveryAddrEnd | 必需 | Long | 在文档中收信人地址的结束位置。 定位与 Range 对象的 最终 属性值相对应。 |
| cpReturnAddrStart | 必需 | Long | 寄信人地址的文档中的起始位置。 定位到一个 Range 对象, 启动 属性的值对应。 |
| cpReturnAddrEnd | 必需 | Long | 在文档中寄信人地址的结束位置。 定位与 Range 对象的 最终 属性值相对应。 |
| xaWidth | 必需 | Long | 以 1/1440 英寸为单位的信封宽度。 |
| yaHeight | 必需 | Long | 以 1/1440 英寸为单位的信封高度。 |
| bstrPrinterName | 必需 | String | "信封选项" 对话框的 "打印选项" 选项卡上指定的打印机名称。 |
| bstrPaperFeed | 必需 | String | "信封选项" 对话框的 "打印选项" 选项卡上指定的送纸方法。 |
| fPrint | 必需 | Boolean | 如此 如果用户已指定要打印的信封。 假 如果用户已指定要插入到文档中的信封。 |
| 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
另请参阅
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。