CreateNewDocument Method

Microsoft PowerPoint Visual Basic

Creates a new Web presentation associated with the specified hyperlink.

expression.CreateNewDocument(FileName, EditNow, Overwrite)

expression    Required. An expression that returns a Hyperlink object.

FileName    Required String. The path and file name of the document.

EditNow   Required MsoTriState. Determines whether the document is opened immediately in its associated editor.

MsoTriState can be one of these MsoTriState constants.
msoCTrue
msoFalse Do not open the document immediately.
msoTriStateMixed
msoTriStateToggle
msoTrue Default. Open the document immediately in its associated editor to modify it.

Overwrite   Required MsoTriState. Determines whether any existing file of the same name in the same folder is overwritten.

MsoTriState can be one of these MsoTriState constants.
msoCTrue
msoFalse Default. Preserve any existing file of the same name in the same folder, requiring a new file name to be specified in the FileName argument.
msoTriStateMixed
msoTriStateToggle
msoTrue Overwrite any existing file of the same name in the same folder.

Example

This example creates a new Web presentation to be associated with hyperlink one on slide one. The new presentation is called Brittany.ppt, and it overwrites any file of the same name in the HTMLPres folder. The new presentation document is loaded into Microsoft PowerPoint immediately for editing.

ActivePresentation.Slides(1).Hyperlinks(1).CreateNewDocument _
    FileName:="C:\HTMLPres\Brittany.ppt", _
    EditNow:=msoTrue, _
    Overwrite:=msoTrue