Name related procedures in class Document (Word VBA)

This page presents procedures from class Document related to the theme Name: ActiveThemeDisplayName, FormattingShowUserStyleName, FullName, Name, OMathFontName, OriginalDocumentTitle, RevisedDocumentTitle and SelectContentControlsByTitle

ActiveThemeDisplayName

Returns the display name of the active theme for the specified document.

The ActiveThemeDisplayName property returns "none" if the document doesn't have an active theme. A theme's display name is the name that appears in the Theme dialog box. This name may not correspond to the string you would use to set a default theme or to apply a theme to a document.

Sub DisplayThemeName() 
 ActiveDocument.ApplyTheme "artsy 100" 
 MsgBox ActiveDocument.ActiveThemeDisplayName 
End Sub

FormattingShowUserStyleName

Returns or sets a Boolean that represents whether to show user-defined styles.

This property corresponds to the Hide built-in name when alternate names exists check box in the Styles Gallery Options dialog box. Setting the FormattingShowUserStyleName property to True hides built-in styles when alternate user-defined styles exist. For example, if a user creates a heading style, such as Heading 1 or Heading 2, to take advantage of other built-in features of Microsoft Word, such as tables of contents, the user-defined style takes precedence, and the similarly named built-in style is not shown in the list of style names.

ActiveDocument.FormattingShowUserStyleName = True

FullName

Returns a String that represents the name of a document, including the path.

Using this property is equivalent to using the Path, PathSeparator, and Name properties in sequence.

Sub DocName() 
 MsgBox ActiveDocument.FullName 
End Sub

Name

Returns the name of the specified object.

abook = Documents("Hello.doc").Bookmarks(1).Name

OMathFontName

Returns or sets a String that represents the name of the font used in a document to display equations.

ActiveDocument.OMathFontName =

OriginalDocumentTitle

Returns a String that represents the document title for the original document after running a legal-blackline document compare function.

To perform a legal-blackline document compare, use the CompareDocuments method.

Dim strOriginalDocumentTitle As String
strOriginalDocumentTitle = ActiveDocument.OriginalDocumentTitle

RevisedDocumentTitle

Returns a String that represents the document title for a revised document after running a legal-blackline document compare function.

To perform a legal-blackline document compare, use the CompareDocuments method.

Dim strRevisedDocumentTitle As String
strRevisedDocumentTitle = ActiveDocument.RevisedDocumentTitle

SelectContentControlsByTitle

Returns a ContentControls collection that represents all the content controls in a document with the title specified in the Title parameter.

Syntax : expression.SelectContentControlsByTitle (Title)