CreateNewDocument Method

Applies To

MailingLabel object.

Description

Creates a new label document using either the default label options or ones that you specify. Returns a Document object.

Syntax

expression.CreateNewDocument(Name, Address, AutoText, ExtractAddress, LaserTray)

expression Required. An expression that returns a MailingLabel object.

Name Optional Variant. The mailing label name.

Address Optional Variant. The text for the mailing label.

AutoText Optional Variant. The name of the AutoText entry that includes the mailing label text.

ExtractAddress Optional Variant. True to use the address text marked by the user-defined bookmark named "EnvelopeAddress" instead of using the Address argument.

LaserTray Optional Variant. The laser printer tray. Can be one of the following WdPaperTray constants:

  • wdPrinterAutomaticSheetFeed
  • wdPrinterDefaultBin
  • wdPrinterEnvelopeFeed
  • wdPrinterFormSource
  • wdPrinterLargeCapacityBin
  • wdPrinterLargeFormatBin
  • wdPrinterLowerBin
  • wdPrinterManualEnvelopeFeed
  • wdPrinterManualFeed
  • wdPrinterMiddleBin
  • wdPrinterOnlyBin
  • wdPrinterPaperCassette
  • wdPrinterSmallFormatBin
  • wdPrinterTractorFeed
  • wdPrinterUpperBin

See Also

PrintOut method (MailingLabel object).

Example

This example creates a new Avery 2160 minilabel document using a predefined address.

addr = "Dave Edson" & vbCr & "123 Skye St." & vbCr & "Our Town, WA  98004"
Application.MailingLabel.CreateNewDocument _
    Name:="2160 mini", Address:=addr, ExtractAddress:=False
This example creates a new Avery 5664 shipping-label document using the selected text as the address.

addr = Selection.Text
Application.MailingLabel.CreateNewDocument Name:="5664", Address:=addr, _
    LaserTray:=wdPrinterUpperBin
This example creates a new self-adhesive-label document using the EnvelopeAddress bookmark text as the address.

If ActiveDocument.Bookmarks.Exists("EnvelopeAddress") = True Then
    Application.MailingLabel.CreateNewDocument _
        Name:="Self Adhesive Tab 1 1/2""", ExtractAddress:=True
End If