是否存在編輯文檔時發生的事件? 如果沒有,有誰知道我在哪裏可以找到可用的VBA事件列表?事件 - 已編輯文檔
2
A
回答
1
下面是文檔對象的事件:
http://msdn.microsoft.com/en-us/library/aa140279(office.10).aspx
活動
DocumentBeforeClose : Immediately before any open document closes.
DocumentBeforePrint : Before any open document is printed.
DocumentBeforeSave : Before any open document is saved.
DocumentChange : A new document is created, when an existing document is opened, or when another document is made the active document.
DocumentOpen : A document is opened.
EPostageInsert : A user inserts electronic postage into a document.
EPostagePropertyDialog : A user clicks the E-postage Properties (Labels and Envelopes dialog box) button or Print Electronic Postage toolbar button. This event allows a third-party software application to intercept and show their properties dialog box.
MailMergeAfterMerge : After all records in a mail merge have merged successfully.
MailMergeAfterRecordMerge : After each record in the data source successfully merges in a mail merge.
MailMergeBeforeMerge : A merge is executed before any records merge.
MailMergeBeforeRecordMerge : As a merge is executed for the individual records in a merge.
MailMergeDataSourceLoad : The data source is loaded for a mail merge.
MailMergeDataSourceValidate : A user performs address verification by clicking Validate in the Mail Merge Recipients dialog box.
MailMergeWizardSendToCustom : The custom button is clicked on step six of the Mail Merge Wizard.
MailMergeWizardStateChange : A user changes from a specified step to a specified step in the Mail Merge Wizard.
NewDocument : A new document is created.
Quit : The user quits Word.
WindowActivate : Any document window is activated.
WindowBeforeDoubleClick : The editing area of a document window is double-clicked, before the default double-click action.
WindowBeforeRightClick : The editing area of a document window is right-clicked, before the default right-click action.
WindowDeactivate : Any document window is deactivated.
WindowSelectionChange : The selection changes in the active document window.
WindowSize : The application window is resized or moved.
也有自動宏:
AutoNew,的AutoOpen,AutoExec的,AUTOEXIT
0
攔截任何的Word命令,您可以:
1.
按Alt + F8進入宏對話框,並在那裏說:「在宏」, 選擇「Word命令」。
2.
查找並選擇要截取的一個命令 - 例如,攔截打印命令,你需要找到FilePrint和FilePrintDefault。攔截保存命令你需要找到的FileSave,FileSaveAs和FileSaveAll
3.
它說:「在宏」,選擇要保存宏,然後單擊「創建」的模板。
4.
執行該命令所需的代碼將爲您編寫;只需添加您自己的代碼。
1
的命令是WindowSelectionChange
0
您可以嘗試AutoHotkey的監聽按鍵事件,看看我的代碼:
相關問題
- 1. Word Interop Catch文檔編輯事件
- 2. 編輯開始和編輯文本框的已完成事件
- 3. 編輯Word文檔
- 4. WPF Datagrid行編輯「已結束」事件
- 5. WOPI編輯文檔
- 6. 編輯MongoMapper文檔
- 7. WAR文檔中的Java編輯文件
- 8. WPF WebBrowser文檔已完成的事件
- 9. 跟蹤文件狀態,而與Desktop.getDesktop()。編輯(檔案文件)文件編輯
- 10. 文檔編輯工具
- 11. 使用JavaScript編程編輯Google文檔
- 12. 如何編輯文檔庫
- 13. DOM文檔,編輯元素
- 14. 編輯App-V存檔文件
- 15. 可編輯單詞文檔附件
- 16. 用C編輯XML文檔#
- 17. 編輯JS在postbuild事件文件
- 18. 遠程編輯Google文檔
- 19. 在線DMS文檔編輯
- 20. 編輯Word文檔編程C#
- 21. 在iPad上編輯故事板文件
- 22. 文本不可編輯onkeydown事件
- 23. 通過批處理文件編輯谷歌文檔文件
- 24. 使用JSF RichFaces rich編輯word文檔:編輯器?
- 25. 編程相關文檔編輯器
- 26. 庫在php中編輯odt文檔
- 27. gridview編輯事件,更新事件?
- 28. 編輯谷歌文檔與驅動API
- 29. 文檔事件ID
- 30. HTML分頁爲可編輯文檔