_Document Members 

Represents a document.

The following tables list the members exposed by the _Document type.

Public Properties

  Name Description
_CodeName  
ActiveTheme Returns the name of the active theme plus the theme formatting options for the specified document.
ActiveThemeDisplayName Returns the display name of the active theme for the specified document.
ActiveWindow Returns a Window object that represents the active window.
ActiveWritingStyle Returns or sets the writing style for a specified language in the specified document.
Application Returns an Application object that represents the Microsoft Word application.
AttachedTemplate Returns a Template object that represents the template attached to the specified document.
AutoFormatOverride Returns or sets a Boolean that represents whether automatic formatting options override formatting restrictions in a document where formatting restrictions are in effect.
AutoHyphenation Determines if automatic hyphenation is turned on for the specified document.
Background Returns a Shape object that represents the background image for the specified document.
Bookmarks Returns a Bookmarks collection that represents all the bookmarks in a document.
BuiltInDocumentProperties Returns a Microsoft.Office.Core.DocumentProperties collection that represents all the built-in document properties for the specified document.
Characters Returns a Characters collection that represents the characters in a document.
ChildNodeSuggestions Returns a XMLChildNodeSuggestions collection that represents the list of allowed elements for the Document object (which returns the root elements for all attached schemas).
ClickAndTypeParagraphStyle Returns or sets the default paragraph style applied to text by the Click and Type feature in the specified document.
CodeName Returns the code name for the specified document.
CommandBars Returns a Microsoft.Office.Core.CommandBars collection that represents the menu bar and all the toolbars in Microsoft Word.
Comments Returns a Comments collection that represents all the comments in the specified document.
Compatibility Determines if the specified compatibility option is enabled.
ConsecutiveHyphensLimit Returns or sets the maximum number of consecutive lines that can end with hyphens.
Container Returns the object that represents the container application for the specified OLE object.
Content Returns a Range object that represents the main document story.
Creator Returns a 32-bit integer that indicates the application in which the specified object was created.
CustomDocumentProperties Returns a Microsoft.Office.Core.DocumentProperties collection that represents all the custom document properties for the specified document.
DefaultTableStyle Returns an Object that represents the table style that is applied to all newly created tables in a document.
DefaultTabStop Returns or sets the interval (in points) between the default tab stops in the specified document.
DefaultTargetFrame Returns or sets a String indicating the browser frame in which to display a Web page reached through a hyperlink.
DisableFeatures Determines if all features introduced after the version specified in the DisableFeaturesIntroducedAfter property are disabled.
DisableFeaturesIntroducedAfter Disables all features introduced after a specified version of Microsoft Word in the document only.
DocumentLibraryVersions Returns a Microsoft.Office.Core.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.
DoNotEmbedSystemFonts Determines if Microsoft Word embeds common system fonts.
Email Returns an Email object that contains all the e-mail – related properties of the current document.
EmbedLinguisticData Determines if Microsoft Word embeds speech and handwriting, stores East Asian IME keystrokes, and controls text service data received from devices.
EmbedSmartTags Determines if Microsoft Word saves the smart tag information in a document.
EmbedTrueTypeFonts Returns True if Microsoft Word embeds TrueType fonts in a document when it's saved.
Endnotes Returns an Endnotes collection that represents all the endnotes in a range, selection, or document.
EnforceStyle Returns or sets a Boolean that represents whether formatting restrictions are enforced in a protected document.
Envelope Returns an Envelope object that represents envelope functionality and the envelope in the specified document.
FarEastLineBreakLanguage Returns or sets the East Asian language to use when breaking lines of text in the specified document or template.
FarEastLineBreakLevel Returns or sets the line break control level for the specified document.
Fields Returns a read-only Fields collection that represents all the fields in the document, range, or selection.
Footnotes Returns a Footnotes collection that represents all the footnotes in a range, selection, or document.
FormattingShowClear Determines if Microsoft Word is to show clear formatting in the Styles and Formatting task pane.
FormattingShowFilter Returns or sets a WdShowFilter constant that represents the styles and formatting displayed in the Styles and Formatting task pane.
FormattingShowFont Determines if Microsoft Word displays font formatting in the Styles and Formatting task pane.
FormattingShowNumbering Determines if Microsoft Word displays number formatting in the Styles and Formatting task pane.
FormattingShowParagraph Determines if Microsoft Word displays paragraph formatting in the Styles and Formatting task pane.
FormFields Returns a FormFields collection that represents all the form fields in the document, range, or selection.
FormsDesign Returns True if the specified document is in form design mode.
Frames Returns a Frames collection that represents all the frames in a document, range, or selection.
Frameset Returns a Frameset object that represents an entire frames page or a single frame on a frames page.
FullName Specifies the name of a document, template, or cascading style sheet, including the drive or Web path.
GrammarChecked Determines if a grammar check has been run on the specified range or document.
GrammaticalErrors Returns a ProofreadingErrors collection that represents the sentences that failed the grammar check on the specified document or range.
GridDistanceHorizontal Returns or sets 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.
GridDistanceVertical Returns or sets 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.
GridOriginFromMargin Determines if Microsoft Word starts the character grid from the upper-left corner of the page.
GridOriginHorizontal Returns or sets 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.
GridOriginVertical Returns or sets 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.
GridSpaceBetweenHorizontalLines Returns or sets the interval at which Microsoft Word displays horizontal character gridlines in print layout view.
GridSpaceBetweenVerticalLines Returns or sets the interval at which Microsoft Word displays vertical character gridlines in print layout view.
HasMailer This member is used only on the Macintosh. For information about this member, consult the language reference Help included with Microsoft Office Macintosh Edition.
HasPassword Returns True if a password is required to open the specified document.
HasRoutingSlip Determines if the specified document has a routing slip attached to it.
HTMLDivisions Returns an HTMLDivisions object that represents an HTML division in a Web document.
HTMLProject Returns an Microsoft.Office.Core.HTMLProject object in the specified document that represents a top-level project branch, as in the Project Explorer of the Microsoft Script Editor.
Hyperlinks Returns a Hyperlinks collection that represents all the hyperlinks in the specified document, range, or selection.
HyphenateCaps Determine if words in all capital letters can be hyphenated.
HyphenationZone Returns or sets the width of the hyphenation zone, in points.
Indexes Returns an Indexes collection that represents all the indexes in the specified document.
InlineShapes Returns an InlineShapes collection that represents all the InlineShape objects in a document, range, or selection.
IsMasterDocument Determines if the specified document is a master document.
IsSubdocument Determines if the specified document is opened in a separate document window as a subdocument of a master document.
JustificationMode Returns or sets the character spacing adjustment for the specified document.
KerningByAlgorithm Determines if Microsoft Word kerns half-width Latin characters and punctuation marks in the specified document.
Kind Returns or sets the format type that Microsoft Word uses when automatically formatting the specified document.
LanguageDetected Returns or sets a value that specifies whether Microsoft Word has detected the language of the specified text.
ListParagraphs Returns a ListParagraphs collection that represents all the numbered paragraphs in the document.
Lists Returns a Lists collection that contains all the formatted lists in the specified document.
ListTemplates Returns a ListTemplates collection that represents all the list formats for the specified document.
MailEnvelope Returns an Microsoft.Office.Core.MsoEnvelope object that represents an e-mail header for a document.
Mailer This member is used only on the Macintosh. For information about this member, consult the language reference Help included with Microsoft Office Macintosh Edition.
MailMerge Returns a MailMerge object that represents the mail merge functionality for the specified document.
Name Returns the name of the specified object.
NoLineBreakAfter Returns or sets the kinsoku characters after which Microsoft Word will not break a line.
NoLineBreakBefore Returns or sets the kinsoku characters before which Microsoft Word will not break a line.
OpenEncoding Returns the encoding used to open the specified document.
OptimizeForWord97 Determines if Microsoft Word optimizes the current document for viewing in Word 97.
PageSetup Returns a PageSetup object that's associated with the specified document.
Paragraphs Returns a Paragraphs collection that represents all the paragraphs in the specified document.
Parent Returns an object that represents the parent object of the specified object.
Password Sets a password that must be supplied to open the specified document.
PasswordEncryptionAlgorithm Returns a String indicating the algorithm Microsoft Word uses for encrypting documents with passwords.
PasswordEncryptionFileProperties Returns True if Microsoft Word encrypts file properties for password-protected documents.
PasswordEncryptionKeyLength Returns an Integer indicating the key length of the algorithm Microsoft Word uses when encrypting documents with passwords.
PasswordEncryptionProvider Returns a String specifying the name of the algorithm encryption provider that Microsoft Word uses when encrypting documents with passwords.
Path Returns the disk or Web path to the specified object.
Permission Returns a Microsoft.Office.Core.Permission object that represents the permission settings in the specified document.
PrintFormsData Determines if Microsoft Word prints onto a preprinted form only the data entered in the corresponding online form.
PrintFractionalWidths Determines if the specified document is formatted to use fractional point spacing to display and print characters.
PrintPostScriptOverText Determines if PRINT field instructions (such as PostScript commands) in a document are to be printed on top of text and graphics when a PostScript printer is used.
PrintRevisions Determines if revision marks are printed with the document.
ProtectionType Returns the protection type for the specified document.
ReadabilityStatistics Returns a ReadabilityStatistics collection that represents the readability statistics for the specified document.
ReadingLayoutSizeX Returns or sets an Integer that represents the width of pages in a document when it is displayed in reading layout view and is frozen for entering handwritten markup.
ReadingLayoutSizeY Returns or sets an Integer that represents the height of pages in a document when it is displayed in reading layout view and is frozen for entering handwritten markup.
ReadingModeLayoutFrozen Sets or returns a Boolean that represents whether pages displayed in reading layout view are frozen to a specified size for inserting handwritten markup into a document.
ReadOnly Determines if changes to the document cannot be saved to the original document.
ReadOnlyRecommended Determines if Word displays a message box whenever a user opens the document, suggesting that it be opened as read-only.
RemoveDateAndTime Returns or sets a Boolean indicating whether a document stores the date and time metadata for tracked changes.
RemovePersonalInformation Determines if Microsoft Word removes all user information from comments, revisions, and the Properties dialog box upon saving a document.
Revisions Returns a Revisions collection that represents the tracked changes in the document or range.
Routed Determines if the specified document has been routed to the next recipient.
RoutingSlip Returns a RoutingSlip object that represents the routing slip information for the specified document.
Saved Determines if the specified document or template hasn't changed since it was last saved.
SaveEncoding Returns or sets the encoding to use when saving a document.
SaveFormat Returns an Integer representing the file format of the specified document or file converter.
SaveFormsData Determines if Microsoft Word saves the data entered in a form as a tab-delimited record for use in a database.
SaveSubsetFonts Determines if Microsoft Word saves a subset of the embedded TrueType fonts with the document.
Scripts Returns a Microsoft.Office.Core.Scripts collection that represents the collection of HTML scripts in the specified object.
Sections Returns a Sections collection that represents the sections in the specified document.
Sentences Returns a Sentences collection that represents all the sentences in the document.
Shapes Returns a Shapes collection that represents all the Shape objects in the specified document.
SharedWorkspace Returns a Microsoft.Office.Core.SharedWorkspace object that represents the Document Workspace in which a specified document is located.
ShowGrammaticalErrors Determines if grammatical errors are marked by a wavy green line in the specified document.
ShowRevisions Determines if tracked changes in the specified document are shown on the screen.
ShowSpellingErrors Determines if Microsoft Word underlines spelling errors in the document.
ShowSummary Determines if an automatic summary is displayed for the specified document.
Signatures Returns a Microsoft.Office.Core.SignatureSet object that represents the digital signatures for a document.
SmartDocument Returns a Microsoft.Office.Core.SmartDocument object that represents the settings for a smart document solution.
SmartTags Returns a SmartTags object that represents a smart tag in a document.
SmartTagsAsXMLProps Determines whether Microsoft Word creates an XML header containing smart tag information when a document containing smart tags is saved as HTML.
SnapToGrid Determines if AutoShapes or East Asian characters are automatically aligned with an invisible grid when they are drawn, moved, or resized in the specified document.
SnapToShapes Determines 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.
SpellingChecked Determines if spelling has been checked throughout the specified range or document.
SpellingErrors Returns a ProofreadingErrors collection that represents the words identified as spelling errors in the specified document or range.
StoryRanges Returns a StoryRanges collection that represents all the stories in the specified document.
Styles Returns a Styles collection for the specified document.
StyleSheets Returns a StyleSheets object that represents the Web style sheets attached to a document.
Subdocuments Returns a Subdocuments collection that represents all the subdocuments in the specified range or document.
SummaryLength Returns or sets the length of the summary as a percentage of the document length.
SummaryViewMode Returns or sets the way a summary is displayed.
Sync Returns a Sync object that provides access to the methods and properties for documents that are part of a Document Workspace.
Tables Returns a Tables collection that represents all the tables in the specified document.
TablesOfAuthorities Returns a TablesOfAuthorities collection that represents the tables of authorities in the specified document.
TablesOfAuthoritiesCategories Returns a TablesOfAuthoritiesCategories collection that represents the available tables of authorities categories for the specified document.
TablesOfContents Returns a TablesOfContents collection that represents the tables of contents in the specified document.
TablesOfFigures Returns a TablesOfFigures collection that represents the tables of figures in the specified document.
TextEncoding Returns or sets the code page, or character set, that Microsoft Word uses for a document saved as an encoded text file.
TextLineEnding Returns or sets a WdLineEndingType constant indicating how Microsoft Word marks the line and paragraph breaks in documents saved as text files.
TrackRevisions Determines if changes are tracked in the specified document.
Type Returns the document type (template or document).
UpdateStylesOnOpen Determines if the styles in the specified document are updated to match the styles in the attached template each time the document is opened.
UserControl Determines if the document or application was created or opened by the user.
Variables Returns a Variables collection that represents the variables stored in the specified document.
VBASigned Determines if the Visual Basic for Applications (VBA) project for the specified document has been digitally signed.
VBProject Returns the VBProject object for the specified template or document.
Versions Returns a Versions collection that represents all the versions of the specified document.
WebOptions Returns the WebOptions object, which contains document-level attributes used by Microsoft Word when you save a document as a Web page or open a Web page.
Windows Returns a Windows collection that represents all windows for the specified document (for example, Sales.doc:1 and Sales.doc:2).
Words Returns a Words collection that represents all the words in a document.
WritePassword Sets a password for saving changes to the specified document.
WriteReserved Determines if the specified document is protected with a write password.
XMLHideNamespaces Returns a Boolean that represents whether to hide the XML namespaces in the list of elements in the XML Structure task pane.
XMLNodes Returns a XMLNodes collection that represents the collection of all XML elements within a document or in a selection or range— including those elements that are only partially within the selection or range.
XMLSaveDataOnly Returns or sets a Boolean that represents whether a document is saved with the XML markup or as text only.
XMLSaveThroughXSLT Returns or sets a String that specifies the path and file name for the Extensible Stylesheet Language Transformation (XSLT) to apply when a user saves a document.
XMLSchemaReferences Returns an XMLSchemaReferences collection that represents the schemas attached to a document.
XMLSchemaViolations Returns an XMLNodes collection that represents all nodes in the document that have validation errors.
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.
XMLUseXSLTWhenSaving Returns a Boolean that represents whether to save a document through an Extensible Stylesheet Language Transformation (XSLT).

Top

Public Methods

  Name Description
AcceptAllRevisions Accepts all tracked changes in the specified document.
AcceptAllRevisionsShown Accepts all revisions in the specified document that are displayed on the screen.
Activate Activates the specified object.
AddDocumentWorkspaceHeader  
AddToFavorites Creates a shortcut to the document or hyperlink and adds it to the Favorites folder.
ApplyTheme Applies a theme to an open document.
AutoFormat Automatically formats a document.
AutoSummarize Creates an automatic summary of the specified document, and returns a Range object.
CanCheckin Determines if Microsoft Word can check in a specified document to a server.
CheckConsistency Searches all text in a Japanese language document and displays instances where character usage is inconsistent for the same words.
CheckGrammar Begins a spelling and grammar check for the specified document or range.
CheckIn Returns a document from a local computer to a server, and sets the local document to read-only so that it cannot be edited locally.
CheckNewSmartTags Accesses the Microsoft Office Web site for available smart tag recognizer and action files.
CheckSpelling Begins a spelling check for the specified document or range.
Close Closes the specified document or documents.
ClosePrintPreview Switches the specified document from print preview to the previous view. If the specified document isn't in print preview, an error occurs.
Compare Displays revision marks that indicate where the specified document differs from another document.
Compare2000  
Compare2002  
ComputeStatistics Returns a statistic based on the contents of the specified document.
ConvertNumbersToText Changes the list numbers and LISTNUM fields in the specified object to text.
ConvertVietDoc Reconverts a Vietnamese document to Unicode using a code page other than the default.
CopyStylesFromTemplate Copies styles from the specified template to a document.
CountNumberedItems Returns the number of bulleted or numbered items and LISTNUM fields in the specified object.
CreateLetterContent Creates and returns a LetterContent object based on the specified letter elements.
DataForm Displays the Data Form dialog box, in which you can add, delete, or modify data records.
DeleteAllComments Deletes all comments from the Comments collection in a document.
DeleteAllCommentsShown Deletes all revisions in a specified document that are displayed on the screen.
DeleteAllEditableRanges Deletes permissions in all ranges for which the specified user or group of users has permission to modify.
DeleteAllInkAnnotations Deletes all handwritten ink annotations in a document.
DetectLanguage Analyzes the specified text to determine the language that it is written in.
EditionOptions This member is used only on the Macintosh. For information about this member, consult the language reference Help included with Microsoft Office Macintosh Edition.
EndReview Terminates a review of a file that has been sent for review using the SendForReview method or that has been automatically placed in a review cycle by sending a document to another user in an e-mail message.
FitToPages Decreases the font size of text just enough so that the document will fit on one fewer pages.
FollowHyperlink Displays a cached document if it's already been downloaded. Otherwise, this method resolves the hyperlink, downloads the target document, and displays the document in the appropriate application.
ForwardMailer This member is used only on the Macintosh. For information about this member, consult the language reference Help included with Microsoft Office Macintosh Edition.
GetCrossReferenceItems Returns an array of items that can be cross-referenced based on the specified cross-reference type.
GetLetterContent Retrieves letter elements from the specified document and returns a LetterContent object.
GoTo Returns a Range object that represents the start position of the specified item.
MakeCompatibilityDefault Sets the compatibility options on the Compatibility tab in the Options dialog box (Tools menu) as the default settings for new documents.
ManualHyphenation Initiates manual hyphenation of a document, one line at a time. The user is prompted to accept or decline suggested hyphenations.
Merge Merges the changes marked with revision marks from one document to another.
Merge2000  
Post Posts the specified document to a public folder in Microsoft Exchange. This method displays the Send to Exchange Folder dialog box so that a folder can be selected.
PresentIt Opens PowerPoint with the specified Word document loaded.
PrintOut Prints all or part of the specified document.
PrintOut2000  
PrintOutOld  
PrintPreview Switches the view to print preview.
Protect Helps to protect the specified document from changes. When a document is protected, users can make only limited changes, such as adding annotations, making revisions, or completing a form.
Protect2002  
Range Returns a Range object by using the specified starting and ending character positions.
RecheckSmartTags Removes smart tags recognized by the grammar checker and rechecks the document content against all smart tag recognizers.
Redo Redoes the last action that was undone (reverses the Undo method). Returns True if the actions were redone successfully.
RejectAllRevisions Rejects all tracked changes in the specified document.
RejectAllRevisionsShown Rejects all revisions in a document that are displayed on the screen.
Reload Reloads a cached document by resolving the hyperlink to the document and downloading it.
ReloadAs Reloads a document based on an HTML document, using the specified document encoding.
RemoveDocumentWorkspaceHeader  
RemoveLockedStyles Purges a document of locked styles when formatting restrictions have been applied in a document.
RemoveNumbers Removes numbers or bullets from the specified object.
RemoveSmartTags Removes all smart tag information from a document.
RemoveTheme Removes the active theme from the current document.
Repaginate Repaginates the entire document.
Reply Opens a new e-mail message— with the sender's address on the To: line— for replying to the active message.
ReplyAll Opens a new e-mail message— with the sender’s and all other recipients' addresses on the To: and Cc: lines, as appropriate— for replying to the active message.
ReplyWithChanges Sends an e-mail message to the author of a document that has been sent out for review, notifying them that a reviewer has completed review of the document.
ResetFormFields Clears all form fields in a document, preparing the form to be filled in again.
Route Routes the specified document, using the document's current routing slip.
RunAutoMacro Runs an auto macro that's stored in the specified document. If the specified auto macro doesn't exist, nothing happens.
RunLetterWizard Runs the Letter Wizard on the specified document.
Save Saves the specified document. If the document hasn't been saved before, the Save As dialog box prompts the user for a file name.
SaveAs Saves the specified document with a new name or format. Some of the arguments for this method correspond to the options in the Save Asdialog box (File menu).
SaveAs2000  
sblt  
Select Selects the specified object.
SelectAllEditableRanges Selects all ranges for which the specified user or group of users has permission to modify.
SelectNodes Returns an XMLNodes collection that represents all the specified nodes in the order in which they appear in the document.
SelectSingleNode Returns an XMLNode object that represents a node in the specified document.
SendFax Sends the specified document as a fax, without any user interaction.
SendFaxOverInternet Sends a document to a fax service provider, who faxes the document to one or more specified recipients.
SendForReview Sends a document in an e-mail message for review by the specified recipients.
SendMail Opens a message window for sending the specified document through Microsoft Exchange.
SendMailer This member is used only on the Macintosh. For information about this member, consult the language reference Help included with Microsoft Office Macintosh Edition.
SetDefaultTableStyle Specifies the table style to use for newly created tables in a document.
SetLetterContent Inserts the contents of the specified LetterContent object into a document.
SetPasswordEncryptionOptions Sets the options Microsoft Word uses for encrypting documents with passwords.
ToggleFormsDesign Toggles form design mode on or off.
TransformDocument Applies the specified Extensible Stylesheet Language Transformation (XSLT) file to the specified document and replaces the document with the results.
Undo Undoes the last action or a sequence of actions, which are displayed in the Undo list. Returns True if the actions were successfully undone.
UndoClear Clears the list of actions that can be undone for the specified document. Corresponds to the list of items that appears when you click the arrow beside the Undo button on the Standard toolbar.
Unprotect Removes protection from the specified document. If the document isn't protected, this method generates an error.
UpdateStyles Copies all styles from the attached template into the document, overwriting any existing styles in the document that have the same name.
UpdateSummaryProperties Updates the keyword and comment text in the Properties dialog box (File menu) to reflect the AutoSummary content for the specified document.
ViewCode Displays the code window for the selected ActiveX control in the specified document.
ViewPropertyBrowser Displays the property window for the selected ActiveX control in the specified document.
WebPagePreview Displays a preview of the current document as it would look if saved as a Web page.

Top

See Also

Reference

_Document Interface
Microsoft.Office.Interop.Word Namespace