事件 - 文档已编辑

发布于 2024-07-08 15:41:58 字数 50 浏览 5 评论 0原文

编辑文档时是否有事件? 如果没有,有谁知道我在哪里可以找到可用 VBA 事件的列表?

Is there an event for when a document is edited?
If not, does anyone know where I could find a list of the available VBA events?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

流殇 2024-07-15 15:41:58

以下是文档对象的事件:

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

Here are the events for the document object:

http://msdn.microsoft.com/en-us/library/aa140279(office.10).aspx

Events

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. 

There are also Auto Macros:

AutoNew, AutoOpen, AutoExec, AutoExit

久伴你 2024-07-15 15:41:58

该命令是WindowSelectionChange

The command is WindowSelectionChange

岁吢 2024-07-15 15:41:58

要拦截任何 Word 命令,您可以:

1.

按 Alt+F8 打开“宏”对话框,其中显示“Macros in”,
选择“字命令”。

2.

查找并选择您要拦截的命令之一 - 例如,要拦截打印命令,您需要找到 FilePrint 和 FilePrintDefault。 要拦截保存命令,您需要找到 FileSave、FileSaveAs 和 FileSaveAll

3.

在显示“宏位于”的地方,选择要存储宏的模板,然后单击“创建”。

4.

执行命令所需的代码将为您编写; 只需添加您自己的代码。

To intercept any Word command, you can:

1.

Press Alt+ F8 to bring up the Macros dialog and where it says “Macros in”,
select “Word Commands”.

2.

Find and select one of the commands you want to intercept – for instance, to intercept the Print commands you need to find FilePrint and FilePrintDefault. To intercept the Save commands you need to find FileSave, FileSaveAs and FileSaveAll

3.

Where it says “Macros in”, select the template you want to store the macro in, and click “Create”.

4.

The code needed to execute the command will be written for you; just add your own code.

始终不够爱げ你 2024-07-15 15:41:58

您可以尝试使用autohotkey来监听按键事件,看我的代码:

捕获MS的按键事件词

You may try autohotkey to listen the keypress event,look at my code:

Capturing keydown event of MS Word

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文