Word) (Document 物件
代表文件。 文件 物件是 文件 集合中的成員。 文件 集合包含目前已開啟,在 Word 中的所有 文件 物件。
註解
使用 檔 (索引) ,其中 index 是檔案名稱或索引編號,可傳回單一 Document 物件。 下列範例會關閉名為 Report.doc 的檔,而不會儲存變更。
Documents("Report.doc").Close SaveChanges:=wdDoNotSaveChanges
編號表示文件的 文件 集合中的位置。 下列範例會啟動第一份文件中的 文件 集合。
Documents(1).Activate
使用 ActiveDocument 屬性來參照具有焦點的檔。 下列範例會使用 Activate 方法來啟動名為 Document 1 的檔。 此範例也會將紙張方向設定為橫向模式,然後列印此文件。
Documents("Document1").Activate
ActiveDocument.PageSetup.Orientation = wdOrientLandscape
ActiveDocument.PrintOut
事件
- BuildingBlockInsert
- Close
- ContentControlAfterAdd
- ContentControlBeforeContentUpdate
- ContentControlBeforeDelete
- ContentControlBeforeStoreUpdate
- ContentControlOnEnter
- ContentControlOnExit
- 新增
- Open
- 同步處理
- XMLAfterInsert
- XMLBeforeDelete
方法
- AcceptAllRevisions
- AcceptAllRevisionsShown
- Activate
- AddToFavorites
- ApplyDocumentTheme
- ApplyQuickStyleSet2
- ApplyTheme
- AutoFormat
- CanCheckin
- CheckConsistency
- CheckGrammar
- CheckIn
- CheckInWithVersion
- CheckSpelling
- Close
- ClosePrintPreview
- 比較
- 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
- 取消復原
- RejectAllRevisions
- RejectAllRevisionsShown
- 重新載入
- ReloadAs
- RemoveDocumentInformation
- RemoveLockedStyles
- RemoveNumbers
- RemoveTheme
- 重新編頁
- 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
- 應用程式
- AttachedTemplate
- AutoFormatOverride
- AutoHyphenation
- 背景
- Bibliography
- Bookmarks
- 廣播
- BuiltInDocumentProperties
- Characters
- ChartDataPointTrack
- ClickAndTypeParagraphStyle
- CoAuthoring
- CodeName
- CommandBars
- 註解
- 相容性
- CompatibilityMode
- ConsecutiveHyphensLimit
- Container
- 內容
- ContentControls
- ContentTypeProperties
- Creator
- CurrentRsid
- CustomDocumentProperties
- CustomXMLParts
- DefaultTableStyle
- DefaultTabStop
- DefaultTargetFrame
- DisableFeatures
- DisableFeaturesIntroducedAfter
- DocumentInspectors
- DocumentLibraryVersions
- DocumentTheme
- DoNotEmbedSystemFonts
- 電子郵件
- EmbedLinguisticData
- EmbedTrueTypeFonts
- EncryptionProvider
- Endnotes
- EnforceStyle
- 信封
- FarEastLineBreakLanguage
- FarEastLineBreakLevel
- Fields
- Final
- Footnotes
- FormattingShowClear
- FormattingShowFilter
- FormattingShowFont
- FormattingShowNextLevel
- FormattingShowNumbering
- FormattingShowParagraph
- FormattingShowUserStyleName
- FormFields
- FormsDesign
- Frames
- 框架組
- FullName
- GrammarChecked
- GrammaticalErrors
- GridDistanceHorizontal
- GridDistanceVertical
- GridOriginFromMargin
- GridOriginHorizontal
- GridOriginVertical
- GridSpaceBetweenHorizontalLines
- GridSpaceBetweenVerticalLines
- HasPassword
- HasVBProject
- HTMLDivisions
- Hyperlinks
- HyphenateCaps
- HyphenationZone
- 索引
- InlineShapes
- IsInAutosave
- IsMasterDocument
- IsSubdocument
- JustificationMode
- KerningByAlgorithm
- 類型
- LanguageDetected
- ListParagraphs
- 清單
- 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
- 修訂
- Saved
- SaveEncoding
- SaveFormat
- SaveFormsData
- SaveSubsetFonts
- 指令碼
- Sections
- SensitivityLabel
- Sentences
- ServerPolicy
- Shapes
- ShowGrammaticalErrors
- ShowSpellingErrors
- 簽章
- SmartDocument
- SnapToGrid
- SnapToShapes
- SpellingChecked
- SpellingErrors
- StoryRanges
- Styles
- StyleSheets
- StyleSortMethod
- 子文件
- 同步處理
- Tables
- TablesOfAuthorities
- TablesOfAuthoritiesCategories
- TablesOfContents
- TablesOfFigures
- TextEncoding
- TextLineEnding
- TrackFormatting
- TrackMoves
- TrackRevisions
- 類型
- UpdateStylesOnOpen
- UseMathDefaults
- UserControl
- 變數
- VBASigned
- VBProject
- WebOptions
- Windows
- WordOpenXML
- Words
- WritePassword
- WriteReserved
- XMLSaveThroughXSLT
- XMLSchemaReferences
- XMLShowAdvancedErrors
- XMLUseXSLTWhenSaving
請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。