Table of contents
TOC
Collapse the table of content
Expand the table of content

Application.ActiveDocument Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

Returns a Document object that represents the active publication. If there are no documents open, an error occurs.

Syntax

expression. ActiveDocument

_expression_A variable that represents an Application object.

Return Value

Document

Example

This example allows the user to assign a file name to the active publication and save it with the new file name. The file name, along with other text, is then inserted after the currently selected text. (Note that Filename must be replaced with a valid publication name for this example to work.)

Sub NewsLetterSave() 

 Dim strFileName As String 

 ' Assign the explicit file name to a variable. 
 strFileName = "Filename" 
 Publisher.ActiveDocument.SaveAs strFileName 

 ' Insert the file name and supporting text after selected text. 
 Selection.TextRange.Collapse pbCollapseEnd 
 Selection.TextRange = _ 
 " This publication has been saved as " &; strFileName 

End Sub

See also

Concepts

Application Object

© 2018 Microsoft