0

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」参照でエラーが発生します。リスト内のさまざまな項目を試しましたが、同じ結果になりました。また、辞書から、テキスト範囲にリビジョンが含まれている可能性があることに気付きましたが、ドキュメント全体にまたがる範囲であっても、リビジョンの数はゼロになります。

4

1 に答える 1

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)
于 2013-11-04T21:39:27.643 に答える