CreateNewDocument Method

See Also         Example         Applies To

Syntax 1: Creates a new document linked to the specified hyperlink. Returns a Document object.

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

Syntax 1

expression.CreateNewDocument(FileName, EditNow, Overwrite)

Syntax 2

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

expression   Syntax 1: Required. An expression that returns a Hyperlink object.

Syntax 2: Required. An expression that returns a MailingLabel object.

FileName   Required String. The file name of the specified document.

EditNow   Required Boolean. True to have the specified document open immediately in its associated editing environment.. The default value is True.

Overwrite   Required Boolean. True to overwrite any existing file of the same name in the same folder. False if any existing file of the same name is preserved and the FileName argument specifies a new file name. The default value is False.

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