Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Automation - Getting the number of pages
Message
From
09/01/2003 07:10:10
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00739686
Message ID:
00739730
Views:
5
This message has been marked as the solution to the initial question of the thread.
>Okay, its eluding me : )
>Does anyone know how to get the number of pages in a word document through
>word automation in foxpro?
>
>Thanks
>
>Sam
#DEFINE wdStatisticWords	0	
#DEFINE wdStatisticLines	1	
#DEFINE wdStatisticPages	2	
#DEFINE wdStatisticCharacters	3	
#DEFINE wdStatisticParagraphs	4	
#DEFINE wdStatisticCharactersWithSpaces	5	
#DEFINE wdStatisticFarEastCharacters	6	

#DEFINE wdDoNotSaveChanges	0	

lcDocName = getfile('doc')
oWord=createobject("word.application")	&& Create word object
WITH oWord
  .documents.open(lcDocName)
  WITH .ActiveDocument
    ? "Chars: ",.ComputeStatistics(wdStatisticCharacters)
    ? "Charswspaces: ",.ComputeStatistics(wdStatisticCharactersWithSpaces)
    ? "Lines: ",.ComputeStatistics(wdStatisticLines)
    ? "Pages: ",.ComputeStatistics(wdStatisticPages)
    ? "Paragraphs: ",.ComputeStatistics(wdStatisticParagraphs)
    ? "Words: ",.ComputeStatistics(wdStatisticWords)
  ENDWITH
  .Quit(wdDoNotSaveChanges)
ENDWITH
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform