Application 对象 (Word)
表示 Microsoft Word 应用程序。 Application 对象包含可返回顶级对象的属性和方法。 例如,ActiveDocument 属性返回 Document 对象。
Application 属性可用于返回 Application 对象。 以下示例显示 Word 的用户名。
MsgBox Application.UserName
许多属性和方法都返回最常用的用户界面对象,如活动文档(ActiveDocument 属性)。无需添加 Application 对象限定符,即可使用这些属性和方法。 例如,可以编写 ,而不是编写 Application.ActiveDocument.PrintOut
ActiveDocument.PrintOut
。 可以在不使用 Application 对象限定符的情况下使用的属性和方法被视为“全局”。若要在对象浏览器中查看全局属性和方法,请在“类”框中单击<globals>
列表顶部。 (另请参阅 Global 对象。)
备注
若要使用“自动化”(旧称为“OLE 自动化”)从另一个应用程序控制 Word,请使用 Microsoft Visual Basic 的 CreateObject 或 GetObject 函数返回 Word Application 对象。 下列 Microsoft Excel 示例可启动 Word(如果尚未运行的话),并打开现有文档。
Set wrd = GetObject(, "Word.Application")
wrd.Visible = True
wrd.Documents.Open "C:\My Documents\Temp.doc"
Set wrd = Nothing
- DocumentBeforeClose
- DocumentBeforePrint
- DocumentBeforeSave
- DocumentChange
- DocumentOpen
- DocumentSync
- EPostageInsert
- EPostageInsertEx
- EPostagePropertyDialog
- MailMergeAfterMerge
- MailMergeAfterRecordMerge
- MailMergeBeforeMerge
- MailMergeBeforeRecordMerge
- MailMergeDataSourceLoad
- MailMergeDataSourceValidate
- MailMergeDataSourceValidate2
- MailMergeWizardSendToCustom
- MailMergeWizardStateChange
- NewDocument
- ProtectedViewWindowActivate
- ProtectedViewWindowBeforeClose
- ProtectedViewWindowBeforeEdit
- ProtectedViewWindowDeactivate
- ProtectedViewWindowOpen
- ProtectedViewWindowSize
- Quit
- WindowActivate
- WindowBeforeDoubleClick
- WindowBeforeRightClick
- WindowDeactivate
- WindowSelectionChange
- WindowSize
- XMLSelectionChange
- XMLValidationError
- Activate
- AddAddress
- AutomaticChange
- BuildKeyCode
- CentimetersToPoints
- ChangeFileOpenDirectory
- CheckGrammar
- CheckSpelling
- CleanString
- CompareDocuments
- DDEExecute
- DDEInitiate
- DDEPoke
- DDERequest
- DDETerminate
- DDETerminateAll
- DefaultWebOptions
- GetAddress
- GetDefaultTheme
- GetSpellingSuggestions
- GoBack
- GoForward
- Help
- HelpTool
- InchesToPoints
- Keyboard
- KeyboardBidi
- KeyboardLatin
- KeyString
- LinesToPoints
- ListCommands
- LoadMasterList
- LookupNameProperties
- MergeDocuments
- MillimetersToPoints
- Move
- NewWindow
- NextLetter
- OnTime
- OrganizerCopy
- OrganizerDelete
- OrganizerRename
- PicasToPoints
- PixelsToPoints
- PointsToCentimeters
- PointsToInches
- PointsToLines
- PointsToMillimeters
- PointsToPicas
- PointsToPixels
- PrintOut
- ProductCode
- PutFocusInMailHeader
- Quit
- Repeat
- ResetIgnoreAll
- Resize
- Run
- ScreenRefresh
- SetDefaultTheme
- ShowClipboard
- ShowMe
- SubstituteFont
- ToggleKeyboard
- ActiveDocument
- ActiveEncryptionSession
- ActivePrinter
- ActiveProtectedViewWindow
- ActiveWindow
- AddIns
- Application
- ArbitraryXMLSupportAvailable
- Assistance
- AutoCaptions
- AutoCorrect
- AutoCorrectEmail
- AutomationSecurity
- BackgroundPrintingStatus
- BackgroundSavingStatus
- Bibliography
- BrowseExtraFileTypes
- Browser
- Build
- CapsLock
- Caption
- CaptionLabels
- ChartDataPointTrack
- CheckLanguage
- COMAddIns
- CommandBars
- Creator
- CustomDictionaries
- CustomizationContext
- DefaultLegalBlackline
- DefaultSaveFormat
- DefaultTableSeparator
- Dialogs
- DisplayAlerts
- DisplayAutoCompleteTips
- DisplayDocumentInformationPanel
- DisplayRecentFiles
- DisplayScreenTips
- DisplayScrollBars
- Documents
- DontResetInsertionPointProperties
- EmailOptions
- EmailTemplate
- EnableCancelKey
- FeatureInstall
- FileConverters
- FileDialog
- FileValidation
- FindKey
- FocusInMailHeader
- FontNames
- HangulHanjaDictionaries
- Height
- International
- IsObjectValid
- IsSandboxed
- KeyBindings
- KeysBoundTo
- LandscapeFontNames
- Language
- Languages
- LanguageSettings
- Left
- ListGalleries
- MacroContainer
- MailingLabel
- MailMessage
- MailSystem
- MAPIAvailable
- MathCoprocessorAvailable
- MouseAvailable
- Name
- NewDocument
- NormalTemplate
- NumLock
- OMathAutoCorrect
- OpenAttachmentsInFullScreen
- Options
- Parent
- Path
- PathSeparator
- PickerDialog
- PortraitFontNames
- PrintPreview
- ProtectedViewWindows
- RecentFiles
- RestrictLinkedStyles
- ScreenUpdating
- Selection
- SensitivityLabelPolicy
- ShowAnimation
- ShowStartupDialog
- ShowStylePreviews
- ShowVisualBasicEditor
- SmartArtColors
- SmartArtLayouts
- SmartArtQuickStyles
- SpecialMode
- StartupPath
- StatusBar
- SynonymInfo
- System
- TaskPanes
- Tasks
- Templates
- Top
- UndoRecord
- UsableHeight
- UsableWidth
- UserAddress
- UserControl
- UserInitials
- UserName
- VBE
- Version
- Visible
- Width
- Windows
- WindowState
- WordBasic
- XMLNamespaces
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。