Application.EPostageInsertEx Event (Word)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Occurs when a user inserts electronic postage into a document.

expression .EPostageInsertEx(Doc, cpDeliveryAddrStart, cpDeliveryAddrEnd, cpReturnAddrStart, cpReturnAddrEnd, xaWidth, yaHeight, bstrPrinterName, bstrPaperFeed, fPrint, fCancel)

expression A variable that represents an Application object that has been declared with events in a class module. For information about using events with the Application object, see Using Events with the Application Object.

Parameters

Name

Required/Optional

Data Type

Description

Doc

Required

Document

The document to which electronic postage is being added.

cpDeliveryAddrStart

Required

Long

The starting position in the document for the delivery address. Positioning corresponds to the value of the Start property for a Range object.

cpDeliveryAddrEnd

Required

Long

The ending position in the document for the delivery address. Positioning corresponds to the value of the End property for a Range object.

cpReturnAddrStart

Required

Long

The starting position in the document for the return address. Positioning corresponds to the value of the Start property for a Range object.

cpReturnAddrEnd

Required

Long

The ending position in the document for the return address. Positioning corresponds to the value of the End property for a Range object.

xaWidth

Required

Long

The width of the envelope in 1/1440-inch units.

yaHeight

Required

Long

The height of the envelope in 1/1440-inch units.

bstrPrinterName

Required

String

The name of the printer as specified on the Printing Options tab of the Envelope Options dialog box.

bstrPaperFeed

Required

String

The feed method as specified on the Printing Options tab of the Envelope Options dialog box.

fPrint

Required

Boolean

True if the user has specified to print the envelope. False if the user has specified to insert the envelope into the document.

fCancel

Required

Boolean

True cancels inserting the postage.

The following example displays a message to the user. If the user cancels the message, then the action specified by the user is canceled.

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
Show: