FeedSource Property

Microsoft Word Visual Basic

Returns or sets the paper tray for the envelope. Read/write WdPaperTray.

WdPaperTray can be one of these WdPaperTray constants.
wdPrinterAutomaticSheetFeed
wdPrinterDefaultBin
wdPrinterEnvelopeFeed
wdPrinterFormSource
wdPrinterLargeCapacityBin
wdPrinterLargeFormatBin
wdPrinterLowerBin
wdPrinterManualEnvelopeFeed
wdPrinterManualFeed
wdPrinterMiddleBin
wdPrinterOnlyBin
wdPrinterPaperCassette
wdPrinterSmallFormatBin
wdPrinterTractorFeed
wdPrinterUpperBin

expression.FeedSource

expression    Required. An expression that returns one of the objects in the Applies To list.

Note  If you use this property before an envelope has been added to the document, an error occurs.

Example

This example asks the user whether envelopes are fed into the printer manually. If the answer is yes, the example sets the paper tray to manual envelope feed.

Sub exFeedSource()

    Dim intResponse As Integer

    intResponse = _
        MsgBox("Are the envelopes manually fed?", vbYesNo)
    If intResponse = vbYes then
        On Error GoTo errhandler
        ActiveDocument.Envelope.FeedSource = _
            wdPrinterManualEnvelopeFeed
    End If

    Exit Sub

errhandler:
    If Err = 5852 Then MsgBox _
        "Envelope not part of the active document"

End Sub