Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Document.CodeName Property

Office 2007
Returns the code name for the specified document. Read-only String.

Syntax

expression.CodeName

expression   A variable that represents a Document object.

Remarks

The code name is the name for the module that houses event macros for a document. The default name for the module is "ThisDocument"; you can view it in the Project window. For information about using events with the Document object, see Using Events with the Document Object.

Example

This example returns the name of the code window for the active document.

Visual Basic for Applications
Msgbox ActiveDocument.CodeName



Community Additions

ADD
Show:
© 2015 Microsoft