bbqq021
04-30-2013, 11:11 PM
I have been trying to write some code for some time, i'm into the final stages or ironing out the minor problems. I have one really annoying glitch that i wouldn't mind some help on.
Essentially, my colleagues will review word documents and make changes (additions or deletions only) using track changes. On the original text which is deleted or a for a new addition. They will then write a comment explaining why they are making the changes. The code will then extract all the comments followed by all the revisions, put them in a table and then sort them based on the page number and line number.
This works fine apart from when the comment overlaps onto 2 pages. Word reports the position of the comment using the last character whereas it reports the position of the revisions using the initial character meaning the comment is on page 13 however the revision which was immediately after the comment is actually reported to be on page 12.
I am not sure if there are any slicker ways of doing it however I was thinking something along the lines of:
Test to see if the first and last character of a particular range (the comment was on the same page).
If oDoc.Comments(C).Scope.range (start) = oDoc.Comments(C).Scope.range (end) then
Do normal code
Else oDoc.Comments(C).Scope.Information(wdActiveEndAdjustedPageNumber) - 1
As you can see I am not very familiar with the syntax. Frosty tells me I have to collapse the range however this does not mean a lot to me.
Any suggestions would be really appreciated.
Thanks
Will
Essentially, my colleagues will review word documents and make changes (additions or deletions only) using track changes. On the original text which is deleted or a for a new addition. They will then write a comment explaining why they are making the changes. The code will then extract all the comments followed by all the revisions, put them in a table and then sort them based on the page number and line number.
This works fine apart from when the comment overlaps onto 2 pages. Word reports the position of the comment using the last character whereas it reports the position of the revisions using the initial character meaning the comment is on page 13 however the revision which was immediately after the comment is actually reported to be on page 12.
I am not sure if there are any slicker ways of doing it however I was thinking something along the lines of:
Test to see if the first and last character of a particular range (the comment was on the same page).
If oDoc.Comments(C).Scope.range (start) = oDoc.Comments(C).Scope.range (end) then
Do normal code
Else oDoc.Comments(C).Scope.Information(wdActiveEndAdjustedPageNumber) - 1
As you can see I am not very familiar with the syntax. Frosty tells me I have to collapse the range however this does not mean a lot to me.
Any suggestions would be really appreciated.
Thanks
Will