Document.Close method (Publisher)

Closes the current publication and creates a blank publication in its place.

Syntax

expression.Close

expression A variable that represents a Document object.

Remarks

Use the Close method only on an open Document object in another instance of Microsoft Publisher. Attempting to close the active publication in the current instance of Publisher causes an error.

Example

This example opens a publication in a new instance of Publisher for modification and then closes the publication. Note that to make this example work, you must replace FileName with a valid file name.

Sub ModifyAnotherPublication() 
 
 ' Create new instance of Publisher. 
 Dim appPub As New Publisher.Application 
 
 ' Open publication. 
 appPub.Open FileName:="FileName" 
 
 ' Put code here to modify the publication as necessary. 
 
 ' Close the publication. 
 appPub.ActiveDocument.Close 
 
 ' Release the other instance of Publisher. 
 Set appPub = Nothing 
 
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.