Application object (Word)
Represents the Microsoft Word application. The Application object includes properties and methods that return top-level objects. For example, the ActiveDocument property returns a Document object.
Use the Application property to return the Application object. The following example displays the user name for Word.
MsgBox Application.UserName
Many of the properties and methods that return the most common user-interface objects—such as the active document (ActiveDocument property)—can be used without the Application object qualifier. For example, instead of writing Application.ActiveDocument.PrintOut
, you can write ActiveDocument.PrintOut
. Properties and methods that can be used without the Application object qualifier are considered "global." To view the global properties and methods in the Object Browser, click <globals>
at the top of the list in the Classes box. (Also see the Global object.)
Remarks
To use Automation (formerly OLE Automation) to control Word from another application, use the Microsoft Visual Basic CreateObject or GetObject function to return a Word Application object. The following Microsoft Excel example starts Word (if it is not already running) and opens an existing document.
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
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.