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

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.....!
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Get the page count

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.
  #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
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with page count OB Microsoft Word Help 4 June 29th 07 09:36 AM
Word's word count feature should be able to count sentences also Connor Microsoft Word Help 31 November 15th 05 08:03 PM
A word count that appears next to the page count Wordy88 Microsoft Word Help 1 June 24th 05 12:30 AM
Print page word count on every page Bill Page Layout 1 February 21st 05 04:12 PM
Change Line Count to not count blank lines Carol Microsoft Word Help 4 November 27th 04 02:46 PM


All times are GMT +1. The time now is 02:35 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"