ActiveDoc Property

Read-only. Returns the active Document object, the document shown in the active window.

Applies to: Application object

Syntax

[[Set] docRet =] object.ActiveDoc

The ActiveDoc property syntax has these parts:

Part Description
object

Required. An expression that returns an Application object.

docRet Optional. A variable of the Document type.

Remarks

Only one document from the documents, open in the application, can be active. When no documents are open, there is no active document and the ActiveDoc property returns the value Nothing.

Example

This example contains an application-level script. It demonstrates using the ActiveDoc property.

Dim active_doc as Document            ' Declare variable
set active_doc = thisApp.ActiveDoc    ' Get active document
active_doc.Name = "Current_doc"       ' Seta a new filename to  active document

' ... here may be some code for inflation of your document

active_doc.Save()                     ' Save active document with a new name

TRACE active_doc.FullName             ' Display full filename of saved document

 

See Also

Document object