我正在尝试组织Word文档中的修订。我显然缺少一些非常基本的东西,因为我无法走得太远。
以下脚本
tell application "Microsoft Word"
set activeDoc to active document
set revCount to count of revisions of activeDoc
set aRev to first item of revisions of activeDoc
set auth to author of aRev
set when to date value of aRev
end tell
生成以下内容:
tell application "Microsoft Word"
get active document
--> active document
count every revision of active document
--> 1275
get item 1 of every revision of active document
--> current application
Result:
error "The variable aRev is not defined." number -2753 from "aRev"
“set auth”引用发生错误。我已经尝试了列表中的各种项目,结果相同。我还从字典中注意到文本范围可以包含修订版,但即使是跨越整个文档的范围,我也会从修订版的计数中得到零。
答案 0 :(得分:0)
以下任何一项都应解决当前问题:
set aRev to first revision of activeDoc
或
set theRevs to the revisions of activeDoc
set aRev to the first item of theRevs
(我认为以下内容应该有效,但是现在我已经忘记了为什么不这样做了)
set aRev to the first item of (revisions of activeDoc)