Documents.Add method (Publisher)

Adds a new Document object that represents a new publication to the Documents collection.

Syntax

expression.Add (PbWizard, desid)

expression An expression that returns a Documents object.

Parameters

Name Required/Optional Data type Description
PbWizard Optional PbWizard The wizard to use to create the new publication. Can be a PbWizard constant.
desid Optional Long The ID of the design to apply to the new publication.

Return value

Document

Remarks

The desid parameter value should be the ID of the design to apply. You can determine the design ID by creating a new publication that uses the wizard and design that you want in the Publisher user interface and then running the following Visual Basic for Applications (VBA) macro.

Public Sub FindDesignID() 
 
 Dim pbWizard As Wizard 
 Dim pbWizardProperty As WizardProperty 
 
 Set pbWizard = ThisDocument.Wizard 
 Set pbWizardProperty = pbWizard.Properties(1) 
 
 Debug.Print pbWizardProperty.CurrentValueId 
 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.