添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
傻傻的地瓜  ·  Android ...·  2 年前    · 

代表 Microsoft Word 應用程式。 Application 物件包含會傳回最上層物件的屬性和方法。 例如, ActiveDocument 屬性會 傳回 Document 物件。

使用 應用程式 屬性來傳回 應用程式 物件。 下列範例會顯示 Word 的使用者名稱。

MsgBox Application.UserName

許多傳回最常見使用者介面物件的屬性和方法,例如使用中檔 (ActiveDocument 屬性) ,都可以在沒有 Application 物件辨識符號的情況下使用。 例如,您可以撰寫 ,而不是撰寫 Application.ActiveDocument.PrintOutActiveDocument.PrintOut 。 不需要 Application 物件辨 識符號即可使用的屬性和方法會被視為「全域」。若要在 物件瀏覽器中檢視全域屬性和方法,請按一下 <globals> [ 類別 ] 方塊中的清單頂端。 (另請參閱 Global object.)

若要使用 Automation (之前稱為 OLE Automation) 來從另一個應用程式控制 Word,請使用 Microsoft Visual Basic 的 CreateObjectGetObject 函數來傳回 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
  • 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
  • HelpTool
  • InchesToPoints
  • Keyboard
  • KeyboardBidi
  • KeyboardLatin
  • KeyString
  • LinesToPoints
  • ListCommands
  • LoadMasterList
  • LookupNameProperties
  • MergeDocuments
  • MillimetersToPoints
  • NewWindow
  • NextLetter
  • OnTime
  • OrganizerCopy
  • OrganizerDelete
  • OrganizerRename
  • PicasToPoints
  • PixelsToPoints
  • PointsToCentimeters
  • PointsToInches
  • PointsToLines
  • PointsToMillimeters
  • PointsToPicas
  • PointsToPixels
  • PrintOut
  • ProductCode
  • PutFocusInMailHeader
  • Repeat
  • ResetIgnoreAll
  • Resize
  • 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
  • ListGalleries
  • MacroContainer
  • MailingLabel
  • MailMessage
  • MailSystem
  • MAPIAvailable
  • MathCoprocessorAvailable
  • MouseAvailable
  • NewDocument
  • NormalTemplate
  • NumLock
  • OMathAutoCorrect
  • OpenAttachmentsInFullScreen
  • Options
  • Parent
  • 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
  • UndoRecord
  • UsableHeight
  • UsableWidth
  • UserAddress
  • UserControl
  • UserInitials
  • UserName
  • Version
  • Visible
  • Width
  • Windows
  • WindowState
  • WordBasic
  • XMLNamespaces
  • Word 物件模型參考資料
  • 支援和意見反應

    有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應