Obtain page numbers for all track changes

diana
3StarLounger
Posts: 279
Joined: 01 Jun 2010, 00:27

Obtain page numbers for all track changes

Post by diana »

---note was orginally posted as p92544 in Word forum
and moved into this forum ---

The brief is:
an original document contains track changes
Create a new document that contains the original documents track changes only.
The page is to display the orginial whole page with track changes – this is easier for the users to work with & recognise the document contents.


This is my pseudocode:

1. Create a copy of the original document
2. Start from the start of the doc
3. Goto normal view
4. Obtain the revision total count
5. For each revision
    6. Goto and select the revision
    7. Obtain the revisions section and page number
    8. Calculate the selection
    9. eg If the track changes selection is over 2 or more pages
    10. Obtain the correct page numbers and section number
    11. and store in array
12. until all revisions in document

13.Array contains section and page numbers
14.Use array to work out & delete pages between track changes pages[/list]

When I run and test my code -
The results are:
Incorrect section and page numbers in the array ie track changes don’t exist on these pages however inserted page/section number into the array

note I understand how pagination works.


Stepping back the above approach seems complicated.

Now that Ive had time to think an alternative method maybe – although simpler may take longer to process -
1. Create a copy of the original document
2. Start from the start of the doc
3. For each page of the document
    4. If revisions exist on this page
    5. Yes – leave page
    6. No – delete page
7. until all revisions in document

challenges -
very long documents - may run into memory issues

Do you have alternative suggestions to best achieve this? :scratch:

Thank you

dd

User avatar
HansV
Administrator
Posts: 78481
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Obtain page numbers for all track changes

Post by HansV »

Perhaps one of our Word experts will come up with a suggestion, but in my opinion this is not a good idea. To get it right would be a major effort with very little value in return. A document consisting of tracked changes only, without the context, would be next to unreadable. I'd much prefer to use the built-in tools on the Review tab of the ribbon: display the document in original or final form, with or without revisions.

Just my :2cents:
Best wishes,
Hans

diana
3StarLounger
Posts: 279
Joined: 01 Jun 2010, 00:27

Re: Obtain page numbers for all track changes

Post by diana »

I managed to get this working.

This is now resolved & functioning correctly

Thanks again Hans :clapping:

dd

User avatar
HansV
Administrator
Posts: 78481
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Obtain page numbers for all track changes

Post by HansV »

Great. How did you solve it?
Best wishes,
Hans

diana
3StarLounger
Posts: 279
Joined: 01 Jun 2010, 00:27

Re: Obtain page numbers for all track changes

Post by diana »

simple yet works: - my code in a nutshell -

Copy file
Open file
Obtain section & page numbers of track changes
Store in array - & clean up array

‘have to work backwards in doc
Goto end of doc
Do until 1st page
If the section & page number not InArray delete the page
Goto previous page

ta da...

I’ve still more work to build :grin:
ie obtain sections format ie margins & orientation
as if a section break is deleted the previous section inherits the layout
& of course more testing on different doc samples

- dd

User avatar
HansV
Administrator
Posts: 78481
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Obtain page numbers for all track changes

Post by HansV »

Thanks!
Best wishes,
Hans

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: Obtain page numbers for all track changes

Post by macropod »

HansV wrote:Perhaps one of our Word experts will come up with a suggestion, but in my opinion this is not a good idea. To get it right would be a major effort with very little value in return.
I agree. Indeed the project as outlined suggests the kind of environment where manuals are updated by distributing the updated pages only. That's a very bad idea. Organisations relying on that approach tend to end up with people using out-dated manuals because people consider changing the replacement pages is too tedious. I've seen it many times, with the poor outcomes it leads to. See also: http://word.mvps.org/FAQs/Numbering/ChapterNumber.htm" onclick="window.open(this.href);return false;. I do hope that's not what's happening in this case.
Paul Edstein
[Fmr MS MVP - Word]

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: Obtain page numbers for all track changes

Post by macropod »

Cross-posted at: http://social.msdn.microsoft.com/Forums ... e2dd3e919a" onclick="window.open(this.href);return false;
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184" onclick="window.open(this.href);return false;
Paul Edstein
[Fmr MS MVP - Word]