Page 1 of 1

Need a macro for track change

Posted: 2014-06-13 06:37:13
by Nobumi Iyanaga
Hello,

I would like to have a macro that will "accept" all the track changes that are "isTextAttributesChanged". Here is the situation in which such a macro is needed. I have a long document in several versions. I can use MS Word to compare two of them, and generate a file in which all the differences are recorded as "history" or "track changes". I save the file as an rtf file, and open it in NWP, and I can see the differences in the track change panel. However, what I really need is only the text content changes, while there are too many "isTextAttributesChanged" only changes.

If I can "accept" all these "isTextAttributesChanged", I will only have the text content changes, so that it will be much easier to concentrate on them.

I think it is possible to write such a macro, but I don't know how...

Are there any kind souls who can help me to write such a macro (which, I guess, can be useful for other people too...).

Thank you very much in advance.

Best regard,

ni

Re: Need a macro for track change

Posted: 2014-06-13 07:27:25
by phspaelti
Hi Nobumi,

from the way you describe the issue, the following should do the trick:

Code: Select all

$doc = Document.active
foreach $change in  $doc.allTrackedChanges
    if $change.isTextAttributesChanged
        $change.accept
    end
end
I haven't tried this at all, so of course the usual disclaimers apply. (Try it on a back-up copy, etc.)

Re: Need a macro for track change

Posted: 2014-06-13 17:36:13
by Nobumi Iyanaga
Hello Philip,

Thank you for your prompt reply.

I tested your macro. It worked perfectly. I saved it as the macro "Track_change-keep-contents" : its speed is very surprising.

Thank you again for your kind help!

Nobumi