View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Mihidum Mihidum is offline
external usenet poster
 
Posts: 2
Default Get the page count



"Jay Freedman" wrote:

On Sun, 4 May 2008 23:44:02 -0700, Mihidum
wrote:

Hi,
I've an ASP.NET web application on which I need to get the word doc page
count. Since I have many word documents to get the page count, I don't want
to use Word Application object as it will consume a lot of resources on the
server.

Is there a possibility to get the page count by reading the word doc into a
stream & by looking for page delimiters?

Or is there a better way to get the page count without using word
applications objects.

Please help.....!


You can use DSOFile.dll (version 2) to read document properties, including page
count, from an Office 97-2003 format document without opening the document. It
doesn't work with Office 2007 format documents, but you may be able to get
something out of the XML in that container.

See http://www.word.mvps.org/FAQs/MacrosVBA/DSOFile.htm.

Also be aware that the page count of a Word document depends on the printer
driver used to do the layout
(http://www.word.mvps.org/FAQs/Format...extReflow.htm), so what you get from
DSOFile is only an approximation.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.


Thanks a lot Jay. You saved my day