Hi
Does anyone know if it is possible to check the .trackrevisions property of a document (i.e., true/false) without actually opening it up? If so, I'd be grateful if someone could steer me in the right direction.
Thank you.
Dan
Hi
Does anyone know if it is possible to check the .trackrevisions property of a document (i.e., true/false) without actually opening it up? If so, I'd be grateful if someone could steer me in the right direction.
Thank you.
Dan
You could examine the contents of the settings.xml archive in a docx or docm document, to see whether the string <w:trackRevisions/> is present. A whole lot more work than simply opening and checking the document's .TrackRevisions state...
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
As a completion to what macropod said, change the extension from docx/docm to zip and extract it in order to see the settings.xml file, and many other files for that matter.
To show your appreciation
Click ★ Add reputation!
Hello both. My apologies for the delay - I have only just now seen that I posted this question. Thank you for the suggestion about extracting the settings.xml file from the ZIP container - I hadn't thought of that. Admittedly, I haven't yet checked it either because - as you say - that would be a whole lot more effort than the task requires. I have code to that will extract the CustomUI files from the ZIP, so I can't imagine it would require much of an adjustment, but I think - on balance - it would just be easier to open the Word documents and 'brute force' my way through the process. Thank you again.
I'm not sure what you mean by "'brute force' my way through the process". All that's required is to test the revisions property. For example:
ActiveDocument.Revisions.Count
returns how many tracked changes the document contains. Similarly,
ActiveDocument.TrackRevisions
returns whether tracked changes is 'on'.
Hi Macropod - thank you kindly for your response above. To clarify, what I had hoped to be able to do was to check whether I could check the state of the TrackRevisions property in a set of closed word documents - the plan was to be able to check whether track revisions were on/off in any word documents attached to an email before the user clicked send. As you say, it isn't difficult to check the property, but I am envisaging a dozen or so word documents and wanted to avoid having to open each of them. What I was envisaging was something along the lines DSO OLE Document Properties Reader 2.1, which I first came across on Chip Pearson's site.
I spoke without thinking when I said 'brute force', I apologise for causing confusion. What I meant by this is that rather than pull the document apart and check the settings.xml file for the state of the property, it would probably just be easier to loop through all the word documents, open them and check the property, then close them again.
This was for a project I was doing for a friend, but it's no-longer required. I'm still interested to know if there is a solution along the lines of the DSO approach above, but I certainly don't want to bother anyone with it. Thanks again to you and Mrrr for your help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks