Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing a page range in Word
Message
From
05/12/2005 09:44:10
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
 
 
To
03/12/2005 09:58:55
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01074259
Message ID:
01074926
Views:
15
Cetin,
That works perfectly. Thanks so much.

Gary

>Gary,
>It works for me. I think the problem is with the section breaks word inserts when you send to a new document (each page is page 1 within each section), I convert them to page breaks first. ie:
>
>    .Destination = wdSendToNewDocument
>    .Execute
>    * Convert section breaks to manual pagebreaks
>    .ActiveDocument.Range.Find.Execute("^b",,,,,,,,,"^m",wdReplaceAll)
>
>	  m.lcPageList = "3,6-7"
>	  .ActiveDocument.Printout(.t.,,wdPrintRangeOfPages,,,,,1,m.lcPageList)
>
Cetin
>
>>Cetin,
>>Thanks for the pointer. I seem to be doing something wrong however. No matter what arguments I use, the whole document prints instead of a range.
>>
>>oWord.ActiveDocument.Printout(.t.,,wdPrintRangeOfPages,,,,,1,m.lcPageList)
>>oWord.ActiveDocument.Printout(.t.,,wdPrintFromTo,,"1","2",,1,)
>>oWord.ActiveDocument.Printout(.t.,,wdPrintFromTo,,1,2,,1,)
>>
>>etc...
>>
>>I'll be exploring this more next week. Thanks again for the example.
>>
>>Gary
>>
>>
>>>>Hi,
>>>>I create a Word object to produce a mail merge doc with anywhere from 1 to several hundred letters. It's produced as a single doc so the users can review the whole thing and maybe add some individual text to some letters before printing. Now we want to be able to print the individual letters to PDF and email them. My thought now is to spin through the doc file generating individual PDF docs for later distribution. The question is: How to print a page range to a specified printer? Any examples? Thanks.
>>>>
>>>>Gary
>>>
>>>#DEFINE wdPrintRangeOfPages 4
>>>lcPageList = "1,5,8-12,16"
>>>oWord.ActivePrinter = getprinter()
>>>oWord.ActiveDocument.Printout(.t.,,wdPrintRangeOfPages,,,,,1,m.lcPageList)
>>>
>>>Cetin
Previous
Reply
Map
View

Click here to load this message in the networking platform