[英]How Do i turn off tracked changes using macros?
I have been trying to create a macro that will automatically run when I open a new word document that will verify that tracked changes are turned off. 我一直试图创建一个宏,当我打开一个新的Word文档时该宏将自动运行,该文档将验证是否已关闭跟踪的更改。 For some reason, whenever I run a macro that opens a new word document that is a .dotm file that contains a form, it turns on tracked changes and I have not told it to do so.
出于某种原因,每当我运行一个宏以打开一个新的Word文档(该文档是一个包含表单的.dotm文件)时,它都会打开跟踪的更改,而我没有告诉它这样做。
I have tried various different ways of fixing this issue. 我尝试了多种解决此问题的方法。
Before I close the User form that has been opened when I opened the new file, I add this line 在关闭打开新文件时打开的用户表单之前,请添加以下行
ActiveDocument.TrackRevisions = False
I also tried with an if statement 我也尝试了if语句
if(ActiveDocument.TrackRevisions) then
ActiveDocument.TrackRevisions = False
end if
I also tried doing it so that it was not even involved in the user form at all but the document itself by inserting it in the "ThisDocument" section under the "Microsoft Word Objects" File. 我也尝试过这样做,以便通过将其插入“ Microsoft Word Objects”文件下的“ ThisDocument”部分中,甚至根本不涉及用户表单,而是涉及文档本身。 Here is what is located there.
这是那里的东西。
Private Sub Document_New()
UserFormInfo.Show
'ActiveDocument.Bookmarks("cursor").Select
ActiveDocument.TrackRevisions = False
ActiveDocument.Save
End Sub
I expect to have this turn off tracked changes, however, this does not occur. 我希望关闭跟踪的更改,但是不会发生。 Any help is appreciated.
任何帮助表示赞赏。
What ended up working for me is I had to remake my template. 最终对我有用的是我不得不重新制作模板。 I had to export my user form so that it was fully removed from all my word files and then remake the template, after that, I had no problem with tracked changes turning on when I ran my macro to open this template.
我必须导出用户表单,以便将其从我的所有Word文件中完全删除,然后重新制作模板,此后,我在运行宏以打开此模板时打开跟踪更改就没有问题。 I believe it was a setting I must have had turned on when I had made my template.
我相信这是我制作模板时必须打开的设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.