Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ms word applescript单词搜索修订版_Ms Word_Applescript_Revision - Fatal编程技术网

Ms word applescript单词搜索修订版

Ms word applescript单词搜索修订版,ms-word,applescript,revision,Ms Word,Applescript,Revision,我试图在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

我试图在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”引用上。我试过列表中的各种项目,结果都是一样的。我还从字典中注意到,文本范围可以包含修订,但即使是跨整个文档的范围,我从中获得的修订计数也为零。

以下任一项都可以解决当前的问题:

set aRev to first revision of activeDoc

(我原以为下面的办法行得通,但现在我忘了为什么不行)


OSX10.9(Mavericks)、MicrosoftWord2011(这两个版本的最新更新)是第一个让我的简单示例工作的版本。现在第二个是超时,所以我正在努力。我以前见过这种行为,但我从未见过任何文档来帮助我理解集合是如何工作的。文档,我想您会发现最好的是通用A/S文档和示例代码。我认为微软从未为Office2011的AppleScript接口制作过任何软件(Outlook除外)。他们为Word 2004或2008制作了一份A/S指南(我想已经不存在了)。现在,他们也删除了2011年Mac特定的VBA文档,我们只剩下(a)对象模型信息。在VBE中提供,(b)MSDN上Windows Word的对象模型文档,对于Mac并不总是正确的,(c)Word的AppleScript字典,(d)其他一般资料,以及(e)尝试和错误。
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)