Class Document (Word VBA)

The class Document represents a document. The Document object is a member of the Documents collection. The Documents collection contains all the Document objects that are currently open in Word.

The main procedures of class Document are Activate, AddToFavorites, Close, Select, Documents.Add, Documents.Close, Documents.Open and Documents.OpenNoRepairDialog

Set

To use a Document class variable it first needs to be instantiated, for example

Dim doc as Document
Set doc = ActiveDocument

The following procedures can be used to set variables of type Document: Application.ActiveDocument, Application.CompareDocuments, Application.CustomizationContext, Application.MacroContainer, Application.MergeDocuments, Documents.Add, Documents.Item, Documents.Open, Documents.AddBlogDocument, Documents.OpenNoRepairDialog, KeyBinding.Context, KeyBindings.Context, KeysBoundTo.Context, MailingLabel.CreateNewDocument, MailingLabel.CreateNewDocumentByID, Pane.Document, ProtectedViewWindow.Edit, ProtectedViewWindow.Document, Range.Document, RecentFile.Open, Selection.Document, Subdocument.Open, Template.OpenAsDocument, Version.Open, Window.Document, XMLNode.OwnerDocument and Application.Documents

For Each

Here is an example of processing the Document items in a collection.

For Each doc In Documents 
     doc.UpdateStyles 
     doc.Close SaveChanges:=wdSaveChanges 
Next doc

Themes

Some procedures in this class have been grouped together in themes and are described on separate theme pages

Review with its procedures AcceptAllRevisions, AcceptAllRevisionsShown, CheckConsistency, CheckGrammar, CheckSpelling, Comments, Compare, DeleteAllComments, DeleteAllCommentsShown, EndReview, Final, GrammarChecked, GrammaticalErrors, RejectAllRevisions, RejectAllRevisionsShown, Revisions, SendForReview, ShowGrammaticalErrors, ShowSpellingErrors, SpellingChecked, SpellingErrors and TrackRevisions
Format with its procedures ActiveTheme, ActiveWritingStyle, ApplyQuickStyleSet2, ApplyTheme, AutoFormat, AutoFormatOverride, ClickAndTypeParagraphStyle, CopyStylesFromTemplate, DefaultTableStyle, DefaultTabStop, DocumentTheme, DoNotEmbedSystemFonts, EmbedTrueTypeFonts, EnforceStyle, FormattingShowClear, FormattingShowFont, FormattingShowNextLevel, FormattingShowNumbering, FormattingShowParagraph, FreezeLayout, GridOriginFromMargin, LockQuickStyleSet, LockTheme, OMathLeftMargin, OMathRightMargin, PageSetup, ReadingLayoutSizeX, ReadingLayoutSizeY, ReadingModeLayoutFrozen, RemoveDocumentInformation, RemoveLockedStyles, RemovePersonalInformation, RemoveTheme, SaveAsQuickStyleSet, SaveFormat, SaveSubsetFonts, SetDefaultTableStyle, Styles, StyleSheets, StyleSortMethod, TrackFormatting, UpdateStyles and UpdateStylesOnOpen
Name with its procedures ActiveThemeDisplayName, FormattingShowUserStyleName, FullName, Name, OMathFontName, OriginalDocumentTitle, RevisedDocumentTitle and SelectContentControlsByTitle
Save with its procedures AutoSaveOn, CanCheckin, CheckIn, CheckInWithVersion, IsInAutosave, Save, SaveAs2, Saved, SaveEncoding and Documents.Save
Close with its procedures Close, ClosePrintPreview and Documents.Close
Code with its procedures CodeName, VBASigned, VBProject and ViewCode
Open with its procedures CompatibilityMode, OpenEncoding, ReadOnly, ReadOnlyRecommended, SetCompatibilityMode, Documents.CanCheckOut, Documents.CheckOut, Documents.Open and Documents.OpenNoRepairDialog
Export with its procedures ExportAsFixedFormat and ExportAsFixedFormat2
Print with its procedures FitToPages, PrintFormsData, PrintOut, PrintPostScriptOverText, PrintPreview and PrintRevisions
Password with its procedures HasPassword, Password, PasswordEncryptionAlgorithm, PasswordEncryptionFileProperties, PasswordEncryptionKeyLength, PasswordEncryptionProvider, ProtectionType, SetPasswordEncryptionOptions and WritePassword

Methods

These are the main methods of the Document class

Activate - Activates the specified document so that it becomes the active document.

ActiveDocument.Activate

AddToFavorites - Creates a shortcut to the document or hyperlink and adds it to the Favorites folder.

ActiveDocument.AddToFavorites

Select - Selects the contents of the specified document.

ActiveDocument.Select

Documents.Add - Returns a Document object that represents a new, empty document added to the collection of open documents.

Dim doc As Document
Set doc = Documents.Add()

Other Methods

ComputeStatistics - Returns a statistic based on the contents of the specified document.

Dim lngComputeStatistics As Long
lngComputeStatistics = ActiveDocument.ComputeStatistics(Statistic:=wdStatisticCharacters)

ConvertNumbersToText - Changes the list numbers and LISTNUM fields in the specified Document to text.

ActiveDocument.ConvertNumbersToText

CountNumberedItems - Returns the number of bulleted or numbered items and LISTNUM fields in the specified Document object.

Dim lngCountNumberedItems As Long
lngCountNumberedItems = ActiveDocument.CountNumberedItems()

FollowHyperlink - Displays a cached document, if it has already been downloaded. Otherwise, this method resolves the hyperlink, downloads the target document, and displays the document in the appropriate application.

ActiveDocument.FollowHyperlink

GetCrossReferenceItems - Returns an array of items that can be cross-referenced based on the specified cross-reference type.

Dim arrGetCrossReferenceItems() As Variant
arrGetCrossReferenceItems() = ActiveDocument.GetCrossReferenceItems(ReferenceType:=wdRefTypeBookmark)

GoTo - Returns a Range object that represents the start position of the specified item, such as a page, bookmark, or field.

Dim rngGoTo As Range
Set rngGoTo = ActiveDocument.GoTo()

Merge - Merges the changes marked with revision marks from one document to another.

Dim strFileName As String: strFileName =  
ActiveDocument.Merge FileName:=strFileName

Range - Returns a Range object by using the specified starting and ending character positions.

Dim rng As Range
Set rng = ActiveDocument.Range()

RemoveNumbers - Removes numbers or bullets from the specified document.

ActiveDocument.RemoveNumbers

RunLetterWizard - Runs the Letter Wizard on the specified document.

ActiveDocument.RunLetterWizard

SelectNodes - Returns an XMLNodes collection that represents all the nodes that match the XPath parameter in the order in which they appear in the document or range.

Dim strXPath As String: strXPath =  
Dim xmlsSelectNodes As XMLNodes
Set xmlsSelectNodes = ActiveDocument.SelectNodes(XPath:=strXPath)

SelectSingleNode - Returns an XMLNode object that represents the first node that matches the XPath parameter in the specified document.

Dim strXPath As String: strXPath =  
Dim xmlSelectSingleNode As XMLNode
Set xmlSelectSingleNode = ActiveDocument.SelectSingleNode(XPath:=strXPath)

SendFax - Sends the specified document as a fax, without any user interaction.

Dim strAddress As String: strAddress =  
ActiveDocument.SendFax Address:=strAddress

SendFaxOverInternet - Sends a document to a fax service provider, who faxes the document to one or more specified recipients.

ActiveDocument.SendFaxOverInternet

TransformDocument - Applies the specified Extensible Stylesheet Language Transformation (XSLT) file to the specified document and replaces the document with the results.

Dim strPath As String: strPath =  
ActiveDocument.TransformDocument Path:=strPath

Properties

ActiveWindow returns a Window object that represents the active window (the window with the focus).

Dim wndActiveWindow As Window
Set wndActiveWindow = ActiveDocument.ActiveWindow

AttachedTemplate returns a Template template that represents the template attached to the specified document. Read/write Variant.

ActiveDocument.AttachedTemplate =

AutoHyphenation true if automatic hyphenation is turned on for the specified document.

ActiveDocument.AutoHyphenation = True

Background returns a Shape object that represents the background image for the specified document.

ActiveDocument.Background =

Bibliography returns a Bibliography object that represents the bibliography references contained within a document.

Dim bblBibliography As Bibliography
Set bblBibliography = ActiveDocument.Bibliography

Bookmarks returns a Bookmarks collection that represents all the bookmarks in a document.

Dim bkmsBookmarks As Bookmarks
Set bkmsBookmarks = ActiveDocument.Bookmarks

Broadcast returns a Broadcast object that represents a broadcast session, in which presenters can present Word documents to remote participants over the web without the participants needing to have rich clients installed.

Dim brdBroadcast As Broadcast
Set brdBroadcast = ActiveDocument.Broadcast

BuiltInDocumentProperties returns a DocumentProperties collection that represents all the built-in document properties for the specified document.

Dim dpsBuiltInDocumentProperties As DocumentProperties
dpsBuiltInDocumentProperties = ActiveDocument.BuiltInDocumentProperties

Characters returns a Characters collection that represents the characters in a document.

Dim chrsCharacters As Characters
Set chrsCharacters = ActiveDocument.Characters

ChartDataPointTrack returns or sets a Boolean that specifies whether charts in the active document use cell-reference data-point tracking.

ActiveDocument.ChartDataPointTrack = True

CoAuthoring returns a CoAuthoring object that provides the entry point into the co authoring object model.

Dim cagCoAuthoring As CoAuthoring
Set cagCoAuthoring = ActiveDocument.CoAuthoring

CommandBars returns a CommandBars collection that represents the menu bar and all the toolbars in Microsoft Word.

Dim cbsCommandBars As Office.CommandBars
Set cbsCommandBars = ActiveDocument.CommandBars

Compatibility true if the compatibility option specified by the Type argument is enabled. Compatibility options affect how a document is displayed in Microsoft Word.

ActiveDocument.Compatibility(Type:=wdAlignTablesRowByRow) = True

ConsecutiveHyphensLimit returns or sets the maximum number of consecutive lines that can end with hyphens. Read/write.

ActiveDocument.ConsecutiveHyphensLimit =

Container returns the object that represents the container application for the specified document.

Dim objContainer As Object
Set objContainer = ActiveDocument.Container

Content returns a Range object that represents the main document story.

Dim rngContent As Range
Set rngContent = ActiveDocument.Content

ContentControls returns a ContentControls collection that represents all the content controls in a document.

Dim ccsContentControls As ContentControls
Set ccsContentControls = ActiveDocument.ContentControls

ContentTypeProperties returns a MetaProperties collection that represents the metadata stored in a document, such as author name, subject, and company.

Dim mpsContentTypeProperties As Office.MetaProperties
Set mpsContentTypeProperties = ActiveDocument.ContentTypeProperties

CurrentRsid returns a Long that represents a random number that Word assigns to changes in a document.

Dim lngCurrentRsid As Long
lngCurrentRsid = ActiveDocument.CurrentRsid

CustomDocumentProperties returns a DocumentProperties collection that represents all the custom document properties for the specified document.

Dim dpsCustomDocumentProperties As DocumentProperties
dpsCustomDocumentProperties = ActiveDocument.CustomDocumentProperties

CustomXMLParts returns a CustomXMLParts collection that represents the custom XML in the XML data store.

Dim cxmsCustomXMLParts As Office.CustomXMLParts
Set cxmsCustomXMLParts = ActiveDocument.CustomXMLParts

DefaultTargetFrame returns or sets a String indicating the browser frame in which to display a webpage reached through a hyperlink.

ActiveDocument.DefaultTargetFrame =

DisableFeatures true disables all features introduced after the version specified in the DisableFeaturesIntroducedAfter property. The default value is False.

ActiveDocument.DisableFeatures = True

DisableFeaturesIntroducedAfter disables all features introduced after a specified version of Microsoft Word in the document only.

ActiveDocument.DisableFeaturesIntroducedAfter = wd70

DocumentInspectors returns a DocumentInspectors collection that enables you to locate hidden personal information, such as author name, company name, and revision date.

Dim disDocumentInspectors As Office.DocumentInspectors
Set disDocumentInspectors = ActiveDocument.DocumentInspectors

DocumentLibraryVersions returns a DocumentLibraryVersions collection that represents the collection of versions of a shared document that has versioning enabled and that is stored in a document library on a server.

Dim dlvsDocumentLibraryVersions As Office.DocumentLibraryVersions
Set dlvsDocumentLibraryVersions = ActiveDocument.DocumentLibraryVersions

Email returns an Email object that contains all the email-related properties of the current document.

Dim emlEmail As Email
Set emlEmail = ActiveDocument.Email

EmbedLinguisticData true for Microsoft Word to embed speech and handwriting so that data can be converted back to speech or handwriting.

ActiveDocument.EmbedLinguisticData = True

EncryptionProvider returns a String specifying the name of the algorithm encryption provider that Microsoft Word uses when encrypting documents.

ActiveDocument.EncryptionProvider =

Endnotes returns an Endnotes collection that represents all the endnotes in a document.

Dim endsEndnotes As Endnotes
Set endsEndnotes = ActiveDocument.Endnotes

Envelope returns an Envelope object that represents an envelope and envelope features in a document.

Dim envEnvelope As Envelope
Set envEnvelope = ActiveDocument.Envelope

FarEastLineBreakLanguage returns or sets a WdFarEastLineBreakLanguageID that represents the East Asian language to use when breaking lines of text in the specified document or template.

ActiveDocument.FarEastLineBreakLanguage = wdLineBreakJapanese

FarEastLineBreakLevel returns or sets a WdFarEastLineBreakLevel that represents the line break control level for the specified document.

ActiveDocument.FarEastLineBreakLevel = wdFarEastLineBreakLevelCustom

Fields returns a Fields collection that represents all the fields in the document.

Dim fldsFields As Fields
Set fldsFields = ActiveDocument.Fields

Footnotes returns a Footnotes collection that represents all the footnotes in a document.

Dim ftnsFootnotes As Footnotes
Set ftnsFootnotes = ActiveDocument.Footnotes

FormattingShowFilter sets or returns a WdShowFilter constant that represents the styles and formatting displayed in the Styles and Formatting task pane.

ActiveDocument.FormattingShowFilter = wdShowFilterFormattingAvailable

FormFields returns a FormFields collection that represents all the form fields in the document.

Dim ffsFormFields As FormFields
Set ffsFormFields = ActiveDocument.FormFields

FormsDesign true if the specified document is in form design mode.

Dim booFormsDesign As Boolean
booFormsDesign = ActiveDocument.FormsDesign

Frames returns a Frames collection that represents all the frames in a document.

Dim frmsFrames As Frames
Set frmsFrames = ActiveDocument.Frames

Frameset returns a Frameset object that represents an entire frames page or a single frame on a frames page.

Dim frmFrameset As Frameset
Set frmFrameset = ActiveDocument.Frameset

GridDistanceHorizontal returns or sets a Single that represents the amount of horizontal space between the invisible gridlines that Microsoft Word uses when you draw, move, and resize AutoShapes or East Asian characters in the specified document.

ActiveDocument.GridDistanceHorizontal =

GridDistanceVertical returns or sets a Single that represents the amount of vertical space between the invisible gridlines that Microsoft Word uses when you draw, move, and resize AutoShapes or East Asian characters in the specified document.

ActiveDocument.GridDistanceVertical =

GridOriginHorizontal returns or sets a Single that represents the point, relative to the left edge of the page, where you want the invisible grid for drawing, moving, and resizing AutoShapes or East Asian characters to begin in the specified document.

ActiveDocument.GridOriginHorizontal =

GridOriginVertical returns or sets a Single that represents the point, relative to the top of the page, where you want the invisible grid for drawing, moving, and resizing AutoShapes or East Asian characters to begin in the specified document.

ActiveDocument.GridOriginVertical =

GridSpaceBetweenHorizontalLines returns or sets the interval at which Microsoft Word displays horizontal character gridlines in print layout view.

ActiveDocument.GridSpaceBetweenHorizontalLines =

GridSpaceBetweenVerticalLines returns or sets the interval at which Microsoft Word displays vertical character gridlines in print layout view.

ActiveDocument.GridSpaceBetweenVerticalLines =

HasVBProject returns a Boolean that represents whether a document has an attached Microsoft Visual Basic for Applications project.

Dim booHasVBProject As Boolean
booHasVBProject = ActiveDocument.HasVBProject

HTMLDivisions returns an HTMLDivisions collection that represents the HTML DIV elements in a web document.

Dim htmsHTMLDivisions As HTMLDivisions
Set htmsHTMLDivisions = ActiveDocument.HTMLDivisions

Hyperlinks returns a Hyperlinks collection that represents all the hyperlinks in the specified document.

Dim hypsHyperlinks As Hyperlinks
Set hypsHyperlinks = ActiveDocument.Hyperlinks

HyphenateCaps true if words in all capital letters can be hyphenated.

ActiveDocument.HyphenateCaps = True

HyphenationZone returns or sets the width of the hyphenation zone, in points.

ActiveDocument.HyphenationZone =

Indexes returns an Indexes collection that represents all the indexes in the specified document.

Dim idxsIndexes As Indexes
Set idxsIndexes = ActiveDocument.Indexes

InlineShapes returns an InlineShapes collection that represents all the InlineShape objects in a document.

Dim issInlineShapes As InlineShapes
Set issInlineShapes = ActiveDocument.InlineShapes

IsMasterDocument true if the specified document is a master document.

Dim booIsMasterDocument As Boolean
booIsMasterDocument = ActiveDocument.IsMasterDocument

IsSubdocument true if the specified document is a subdocument of a master document.

Dim booIsSubdocument As Boolean
booIsSubdocument = ActiveDocument.IsSubdocument

JustificationMode returns or sets the character spacing adjustment for the specified document.

ActiveDocument.JustificationMode = wdJustificationModeCompress

KerningByAlgorithm true if Microsoft Word kerns half-width Latin characters and punctuation marks in the specified document.

ActiveDocument.KerningByAlgorithm = True

Kind returns or sets the format type that Microsoft Word uses when automatically formatting the specified document.

ActiveDocument.Kind = wdDocumentEmail

LanguageDetected returns or sets a value that specifies whether Microsoft Word has detected the language of the specified text.

ActiveDocument.LanguageDetected = True

ListParagraphs returns a ListParagraphs object that represents all the numbered paragraphs in a document.

Dim lpsListParagraphs As ListParagraphs
Set lpsListParagraphs = ActiveDocument.ListParagraphs

Lists returns a Lists collection that contains all the formatted lists in the specified document.

Dim lstsLists As Lists
Set lstsLists = ActiveDocument.Lists

ListTemplates returns a ListTemplates collection that represents all the list formats for the specified document.

Dim ltsListTemplates As ListTemplates
Set ltsListTemplates = ActiveDocument.ListTemplates

MailEnvelope returns an MsoEnvelope object that represents an email header for a document.

Dim meeMailEnvelope As Office.MsoEnvelope
Set meeMailEnvelope = ActiveDocument.MailEnvelope

MailMerge returns a MailMerge object that represents the mail merge functionality for the specified document.

Dim mmeMailMerge As MailMerge
Set mmeMailMerge = ActiveDocument.MailMerge

NoLineBreakAfter returns or sets the kinsoku characters after which Microsoft Word will not break a line.

ActiveDocument.NoLineBreakAfter =

NoLineBreakBefore returns or sets the kinsoku characters before which Microsoft Word will not break a line.

ActiveDocument.NoLineBreakBefore =

OMathBreakBin returns or sets a WdOMathBreakBin constant that represents where Microsoft Word places binary operators when equations span two or more lines.

ActiveDocument.OMathBreakBin = wdOMathBreakBinAfter

OMathBreakSub returns or sets a WdOMathBreakSub constant that represents how Microsoft Word handles a subtraction operator that falls before a line break.

ActiveDocument.OMathBreakSub = wdOMathBreakSubMinusMinus

OMathIntSubSupLim returns or sets a Boolean that represents the default location of limits for integrals.

ActiveDocument.OMathIntSubSupLim = True

OMathJc returns or sets a WdOMathJc constant that represents the default justification—left, right, centered, or centered as a group—of a group of equations.

ActiveDocument.OMathJc = wdOMathJcCenter

OMathNarySupSubLim returns or sets a Boolean that represents the default location of limits for n-ary objects other than integrals.

ActiveDocument.OMathNarySupSubLim = True

OMaths returns an OMaths collection that represents the OMath objects within the specified range.

Dim omsOMaths As OMaths
Set omsOMaths = ActiveDocument.OMaths

OMathSmallFrac returns or sets a Boolean that represents whether to use small fractions in equations contained within the document.

ActiveDocument.OMathSmallFrac = True

OMathWrap returns or sets a Single that represents the placement of the second line of an equation that wraps to a new line.

ActiveDocument.OMathWrap =

Paragraphs returns a Paragraphs collection that represents all the paragraphs in the specified document.

Dim prgsParagraphs As Paragraphs
Set prgsParagraphs = ActiveDocument.Paragraphs

Parent returns an object that represents the parent object of the specified Document object.

Dim objParent As Object
Set objParent = ActiveDocument.Parent

Path returns the disk or Web path to the document.

Dim strPath As String
strPath = ActiveDocument.Path

Permission returns a Permission object that represents the permission settings in the specified document.

Dim prmPermission As Office.Permission
Set prmPermission = ActiveDocument.Permission

ReadabilityStatistics returns a ReadabilityStatistics collection that represents the readability statistics for the specified document or range.

Dim rssReadabilityStatistics As ReadabilityStatistics
Set rssReadabilityStatistics = ActiveDocument.ReadabilityStatistics

RemoveDateAndTime sets or returns a Boolean indicating whether a document stores the date and time metadata for tracked changes.

ActiveDocument.RemoveDateAndTime = True

Research returns a Research object that represents the research service for a document.

Dim rsrResearch As Research
Set rsrResearch = ActiveDocument.Research

SaveFormsData true if Microsoft Word saves the data entered in a form as a tab-delimited record for use in a database.

ActiveDocument.SaveFormsData = True

Scripts returns a Scripts collection that represents the collection of HTML scripts in the specified object.

Dim scrsScripts As Office.Scripts
scrsScripts = ActiveDocument.Scripts

Sections returns a Section collection that represents the sections in the specified document.

Dim sctsSections As Sections
Set sctsSections = ActiveDocument.Sections

Sentences returns a Sentences collection that represents all the sentences in the document.

Dim sntsSentences As Sentences
Set sntsSentences = ActiveDocument.Sentences

ServerPolicy returns a ServerPolicy object that represents a policy specified for a document stored on a server running Microsoft Office SharePoint Server 2007.

Dim spyServerPolicy As Office.ServerPolicy
Set spyServerPolicy = ActiveDocument.ServerPolicy

Shapes returns a Shapes collection that represents all the Shape objects in the specified document.

Dim shpsShapes As Shapes
Set shpsShapes = ActiveDocument.Shapes

Signatures returns a SignatureSet collection that represents the digital signatures for a document.

Dim sstSignatures As Office.SignatureSet
Set sstSignatures = ActiveDocument.Signatures

SmartDocument returns a SmartDocument object that represents the settings for a smart document solution.

Dim sdtSmartDocument As Office.SmartDocument
Set sdtSmartDocument = ActiveDocument.SmartDocument

SnapToGrid true if AutoShapes or East Asian characters are automatically aligned with an invisible grid when they are drawn, moved, or resized in the specified document.

ActiveDocument.SnapToGrid = True

SnapToShapes true if Microsoft Word automatically aligns AutoShapes or East Asian characters with invisible gridlines that go through the vertical and horizontal edges of other AutoShapes or East Asian characters in the specified document.

ActiveDocument.SnapToShapes = True

StoryRanges returns a StoryRanges collection that represents all the stories in the specified document.

Dim srsStoryRanges As StoryRanges
Set srsStoryRanges = ActiveDocument.StoryRanges

Subdocuments returns a Subdocuments collection that represents all the subdocuments in the specified document.

Dim sbdsSubdocuments As Subdocuments
Set sbdsSubdocuments = ActiveDocument.Subdocuments

Sync

Dim synSync As Office.Sync
Set synSync = ActiveDocument.Sync

Tables returns a Table collection that represents all the tables in the specified document.

Dim tblsTables As Tables
Set tblsTables = ActiveDocument.Tables

TablesOfAuthorities returns a TableOfAuthorities collection that represents the tables of authorities in the specified document.

Dim toasTablesOfAuthorities As TablesOfAuthorities
Set toasTablesOfAuthorities = ActiveDocument.TablesOfAuthorities

TablesOfAuthoritiesCategories returns a TablesOfAuthoritiesCategories collection that represents the available table of authorities categories for the specified document.

Dim toasTablesOfAuthoritiesCategories As TablesOfAuthoritiesCategories
Set toasTablesOfAuthoritiesCategories = ActiveDocument.TablesOfAuthoritiesCategories

TablesOfContents returns a TablesOfContents collection that represents the tables of contents in the specified document.

Dim tocsTablesOfContents As TablesOfContents
Set tocsTablesOfContents = ActiveDocument.TablesOfContents

TablesOfFigures returns a TablesOfFigures collection that represents the tables of figures in the specified document.

Dim tofsTablesOfFigures As TablesOfFigures
Set tofsTablesOfFigures = ActiveDocument.TablesOfFigures

TextEncoding returns or sets the code page, or character set, that Microsoft Word uses for a document saved as an encoded text file.

ActiveDocument.TextEncoding =

TextLineEnding returns or sets a WdLineEndingType constant indicating how Microsoft Word marks the line and paragraph breaks in documents saved as text files.

ActiveDocument.TextLineEnding = wdCRLF

TrackMoves returns or sets a Boolean that represents whether to mark moved text when Track Changes is turned on.

ActiveDocument.TrackMoves = True

Type returns the document type (template or document).

Dim wdtType As WdDocumentType
wdtType = ActiveDocument.Type

UseMathDefaults returns or sets a Boolean that represents whether to use the default math settings when creating new equations.

ActiveDocument.UseMathDefaults = True

UserControl true if the document was created or opened by the user.

ActiveDocument.UserControl = True

Variables returns a Variables collection that represents the variables stored in the specified document.

Dim vrbsVariables As Variables
Set vrbsVariables = ActiveDocument.Variables

WebOptions returns the WebOptions object, which contains document-level attributes used by Microsoft Word when you save a document as a webpage or open a webpage.

Dim wosWebOptions As WebOptions
Set wosWebOptions = ActiveDocument.WebOptions

Windows returns a Windows collection that represents all windows for the specified document.

Dim wndsWindows As Windows
Set wndsWindows = ActiveDocument.Windows

WordOpenXML returns a String that represents the flat XML format for the Word Open XML contents of the document.

Dim strWordOpenXML As String
strWordOpenXML = ActiveDocument.WordOpenXML

Words returns a Words collection that represents all the words in a document.

Dim wrdsWords As Words
Set wrdsWords = ActiveDocument.Words

WorkIdentity

ActiveDocument.WorkIdentity =

WriteReserved true if the specified document is protected with a write password.

Dim booWriteReserved As Boolean
booWriteReserved = ActiveDocument.WriteReserved

XMLSaveThroughXSLT sets or returns a String that specifies the path and file name for the Extensible Stylesheet Language Transformation (XSLT) to apply when a user saves a document.

ActiveDocument.XMLSaveThroughXSLT =

XMLSchemaReferences returns an XMLSchemaReferences collection that represents the schemas attached to a document.

Dim xmlsXMLSchemaReferences As XMLSchemaReferences
Set xmlsXMLSchemaReferences = ActiveDocument.XMLSchemaReferences

XMLShowAdvancedErrors returns or sets a Boolean that represents whether error message text is generated from the built-in Microsoft Word error messages or from the Microsoft XML Core Services (MSXML) 5.0 component included with Office.

ActiveDocument.XMLShowAdvancedErrors = True

XMLUseXSLTWhenSaving returns a Boolean that represents whether to save a document through an Extensible Stylesheet Language Transformation (XSLT). True saves a document through an XSLT.

ActiveDocument.XMLUseXSLTWhenSaving = True

Documents.Count returns a Long that represents the number of documents in the collection.

Dim lngCount As Long
lngCount = Documents.Count

Documents.Parent returns an object that represents the parent object of the specified Documents object.

Dim objParent As Object
Set objParent = Documents.Parent