ExtendScript - postworddocupdate
1) How can I instantly alter the topics, after generating/updating a Word-document?
I tried this with no luck, see the results in my experiment.
2) How can I make sure that my ExtendScript is running only on the Word-Documents that 'Generate or Update'?
We will make projects with 20 or more linked Word-documents. So if one changes we won't run the script on all.
Experiment:
I have a script as following.
Searching all topics within a project => cleanup all inline styling/topic.
That works fine.
I registered the script as an event. (Event: postworddocupdate)
I assumed that this event would trigger from the moment a generate or an update, of a Word-document, has finished. Meaning the topics are made.
Why using this option:
We put multiple Word-documents in one project. We do this with a link, without making a copy of the Word-document.
I linked 2 Word-documents;
- Doc_A.docx
- Doc_B.docx
I 'Generate' the Word-document Doc_A.docx
Result in the 'Output View'
Number of Word-documents present: 2 => project.WordFileManager.count
name Word-document: Doc_A
name Word-document: Doc_B
Start removing inline styling ! => Start searching all topics within the project
Topic: Hello
Location: P:\Mdenbaes\RH_17\STK_N\Hello.htm => default topic
End removing inline styling ! => all topics within the project are handeld
Next:
I 'Generate' the Word-document Doc_B.docx
Result in the 'Output View'
Number of Word-documents present: 2
name Word-document: Doc_A
name Word-document: Doc_B
Start removing inline styling !
Topic: Sect steekkaart PC_124
Location: P:\Mdenbaes\RH_17\STK_N\File_A\Doc_A\Doc_A.htm => now the topic of the First Word-document is found.
Topic: Hello
Location: P:\Mdenbaes\RH_17\STK_N\Hello.htm
End removing inline styling !
As you can guess: If I 'Update' or 'Force update' one of the existing Word-documents: the topics of both Word-documents are shown in the 'Output View'.
