Word XML and Page Count
I recently saw a post on the microsoft.public.office.xml news group wherein was asked:
--------
When I save a word document as XML, it seems that
o:DocumentProperties/o:Pages always comes out as 1. I have tried doing
"update fields" and saving in page layout mode to no avail.
Is this property broken? any other way to determine the number of pages by
looking at the XML?
--------
No one responded, so I was intrigued. Well, I figured it out. It actually is "by design" even though it may seem a little misleading. The <o:Pages> element is "an estimate of the number of pages in the document." (see the Word XML SDK for more info). The tip-off was that it is an estimate. So, I did a series of tests and found out that if you do either of the following two things and save the doc, you will see the correct page count in the <o:DocumentProperties> .
- View the document properties: File | Properties | Statistics
- View the word count: ALT + t + w
If you don't do this, Word has not done the full calculation. Have you noticed that when you open the document at the very bottom Word will give the "approximate" word count? It's there. Watch closely. Anyway. If no one else is fascinated by this, I know I have helped at least one other person besides myself!
Rock Thought for the Day: Neil Young's album, Prairie Wind will be coming out in late September. Make sure you get the special edition CD that has a companion DVD containing a film detailing the recording sessions. Emmy Lou Harris lends her voice on this record along with other greats. It's shaping up to be a legend-making release.
Rock On
Comments
- Anonymous
August 29, 2005
The comment has been removed - Anonymous
August 30, 2005
I have a couple of comments. First, I've been unable to get the o:pages property to change, even following John's suggestions. Also, Word gives an approximate character count on open, but I haven't seen it display a Word count.
Like Shaun, I don't see a big benefit of the pages property in the 2003 WordML format. However, since the concept of physical pages is very important to Word, I think it will be more important in the Office 12 environment. Since <o:pages> is a document property, I see that being in between the presentation and document.
It will definitely be interesting to see how this progresses.
Evans