Document 对象 (Word)
代表一个文档。 Document 对象是 Documents 集合的成员。 Documents 集合包含 Word 中当前打开的所有 Document 对象。
使用 Documents (索引) (其中 index 是文档名称或索引号)可返回单个 Document 对象。 以下示例关闭名为 Report.doc 的文档,而不保存更改。
Documents("Report.doc").Close SaveChanges:=wdDoNotSaveChanges
索引编号代表文档在 Documents 集合中的位置。 以下示例激活 Documents 集合中的第一篇文档。
Documents(1).Activate
使用 ActiveDocument 属性可引用具有焦点的文档。 以下示例使用 Activate 方法激活名为 Document 1 的文档。 另外,以下示例还会将页面方向设置为横向模式,然后再打印文档。
Documents("Document1").Activate
ActiveDocument.PageSetup.Orientation = wdOrientLandscape
ActiveDocument.PrintOut
- BuildingBlockInsert
- Close
- ContentControlAfterAdd
- ContentControlBeforeContentUpdate
- ContentControlBeforeDelete
- ContentControlBeforeStoreUpdate
- ContentControlOnEnter
- ContentControlOnExit
- New
- Open
- Sync
- XMLAfterInsert
- XMLBeforeDelete
- AcceptAllRevisions
- AcceptAllRevisionsShown
- Activate
- AddToFavorites
- ApplyDocumentTheme
- ApplyQuickStyleSet2
- ApplyTheme
- AutoFormat
- CanCheckin
- CheckConsistency
- CheckGrammar
- CheckIn
- CheckInWithVersion
- CheckSpelling
- Close
- ClosePrintPreview
- Compare
- ComputeStatistics
- Convert
- ConvertAutoHyphens
- ConvertNumbersToText
- ConvertVietDoc
- CopyStylesFromTemplate
- CountNumberedItems
- CreateLetterContent
- DataForm
- DeleteAllComments
- DeleteAllCommentsShown
- DeleteAllEditableRanges
- DeleteAllInkAnnotations
- DetectLanguage
- DowngradeDocument
- EndReview
- ExportAsFixedFormat
- ExportAsFixedFormat2
- FitToPages
- FollowHyperlink
- FreezeLayout
- GetCrossReferenceItems
- GetLetterContent
- GetWorkflowTasks
- GetWorkflowTemplates
- GoTo
- LockServerFile
- MakeCompatibilityDefault
- ManualHyphenation
- Merge
- Post
- PresentIt
- PrintOut
- PrintPreview
- Protect
- Range
- Redo
- RejectAllRevisions
- RejectAllRevisionsShown
- Reload
- ReloadAs
- RemoveDocumentInformation
- RemoveLockedStyles
- RemoveNumbers
- RemoveTheme
- Repaginate
- ReplyWithChanges
- ResetFormFields
- ReturnToLastReadPosition
- RunAutoMacro
- RunLetterWizard
- Save
- SaveAs2
- SaveAsQuickStyleSet
- Select
- SelectAllEditableRanges
- SelectContentControlsByTag
- SelectContentControlsByTitle
- SelectLinkedControls
- SelectNodes
- SelectSingleNode
- SelectUnlinkedControls
- SendFax
- SendFaxOverInternet
- SendForReview
- SendMail
- SetCompatibilityMode
- SetDefaultTableStyle
- SetLetterContent
- SetPasswordEncryptionOptions
- ToggleFormsDesign
- TransformDocument
- Undo
- UndoClear
- Unprotect
- UpdateStyles
- ViewCode
- ViewPropertyBrowser
- WebPagePreview
- ActiveTheme
- ActiveThemeDisplayName
- ActiveWindow
- ActiveWritingStyle
- Application
- AttachedTemplate
- AutoFormatOverride
- AutoHyphenation
- Background
- Bibliography
- Bookmarks
- Broadcast
- BuiltInDocumentProperties
- Characters
- ChartDataPointTrack
- ClickAndTypeParagraphStyle
- CoAuthoring
- CodeName
- CommandBars
- Comments
- Compatibility
- CompatibilityMode
- ConsecutiveHyphensLimit
- Container
- Content
- ContentControls
- ContentTypeProperties
- Creator
- CurrentRsid
- CustomDocumentProperties
- CustomXMLParts
- DefaultTableStyle
- DefaultTabStop
- DefaultTargetFrame
- DisableFeatures
- DisableFeaturesIntroducedAfter
- DocumentInspectors
- DocumentLibraryVersions
- DocumentTheme
- DoNotEmbedSystemFonts
- EmbedLinguisticData
- EmbedTrueTypeFonts
- EncryptionProvider
- Endnotes
- EnforceStyle
- Envelope
- FarEastLineBreakLanguage
- FarEastLineBreakLevel
- Fields
- Final
- Footnotes
- FormattingShowClear
- FormattingShowFilter
- FormattingShowFont
- FormattingShowNextLevel
- FormattingShowNumbering
- FormattingShowParagraph
- FormattingShowUserStyleName
- FormFields
- FormsDesign
- Frames
- Frameset
- FullName
- GrammarChecked
- GrammaticalErrors
- GridDistanceHorizontal
- GridDistanceVertical
- GridOriginFromMargin
- GridOriginHorizontal
- GridOriginVertical
- GridSpaceBetweenHorizontalLines
- GridSpaceBetweenVerticalLines
- HasPassword
- HasVBProject
- HTMLDivisions
- Hyperlinks
- HyphenateCaps
- HyphenationZone
- Indexes
- InlineShapes
- IsInAutosave
- IsMasterDocument
- IsSubdocument
- JustificationMode
- KerningByAlgorithm
- Kind
- LanguageDetected
- ListParagraphs
- Lists
- ListTemplates
- LockQuickStyleSet
- LockTheme
- MailEnvelope
- MailMerge
- 名称
- NoLineBreakAfter
- NoLineBreakBefore
- OMathBreakBin
- OMathBreakSub
- OMathFontName
- OMathIntSubSupLim
- OMathJc
- OMathLeftMargin
- OMathNarySupSubLim
- OMathRightMargin
- OMaths
- OMathSmallFrac
- OMathWrap
- OpenEncoding
- OptimizeForWord97
- OriginalDocumentTitle
- PageSetup
- Paragraphs
- Parent
- Password
- PasswordEncryptionAlgorithm
- PasswordEncryptionFileProperties
- PasswordEncryptionKeyLength
- PasswordEncryptionProvider
- Path
- Permission
- PrintFormsData
- PrintPostScriptOverText
- PrintRevisions
- ProtectionType
- ReadabilityStatistics
- ReadingLayoutSizeX
- ReadingLayoutSizeY
- ReadingModeLayoutFrozen
- ReadOnly
- ReadOnlyRecommended
- RemoveDateAndTime
- RemovePersonalInformation
- Research
- RevisedDocumentTitle
- Revisions
- Saved
- SaveEncoding
- SaveFormat
- SaveFormsData
- SaveSubsetFonts
- Scripts
- Sections
- 敏感度标签
- Sentences
- ServerPolicy
- Shapes
- ShowGrammaticalErrors
- ShowSpellingErrors
- Signatures
- SmartDocument
- SnapToGrid
- SnapToShapes
- SpellingChecked
- SpellingErrors
- StoryRanges
- Styles
- StyleSheets
- StyleSortMethod
- Subdocuments
- Sync
- Tables
- TablesOfAuthorities
- TablesOfAuthoritiesCategories
- TablesOfContents
- TablesOfFigures
- TextEncoding
- TextLineEnding
- TrackFormatting
- TrackMoves
- TrackRevisions
- Type
- UpdateStylesOnOpen
- UseMathDefaults
- UserControl
- Variables
- VBASigned
- VBProject
- WebOptions
- Windows
- WordOpenXML
- Words
- WritePassword
- WriteReserved
- XMLSaveThroughXSLT
- XMLSchemaReferences
- XMLShowAdvancedErrors
- XMLUseXSLTWhenSaving
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。