|
-
August 16th, 2004, 02:30 PM
#1
All MS Word/Office automation gurus out there!
I am trying to print a range of pages using word but have not been able to do that, no matter what.
I am not sure how to pass the paramaters for the page range option, so any suggestions are very much appreciated.
I am calling the print out method like this
Doc.PrintOut(covFalse, // Background.
covOptional, // Append.
covOptional, // Range.
covOptional, // OutputFileName.
covOptional, // // From.
covOptional, // // To.
covOptional, // Item.
COleVariant((long)1), // Copies.
covOptional, // Pages.
covOptional, // PageType.
covOptional, // PrintToFile.
covOptional, // Collate.
covOptional, // ActivePrinterMacGX.
covOptional, // ManualDuplexPrint.
covOptional, // PrintZoomColumn New with Word 2002
covOptional, // PrintZoomRow ditto
covOptional, // PrintZoomPaperWidth ditto
covOptional);
Well this print out fine, but when I try to pass the params for range, it fails, and if I try to use Pages param instead of from/to, then it still prints the whole document.
I have tried passing the range as
VARIANT vName;
vName.vt = VT_BSTR;
vName.bstrVal = SysAllocString(L"WdPrintOutRange.wdPrintFromTo");
and the from/to as (long) 1/(long) 2, but it failed, so then Ipassed the pages options as below
VARIANT vName2;
vName2.vt = VT_BSTR;
vName2.bstrVal = SysAllocString(L"1-2");
But it instead prints the whole doc.
Please help!
Pauli
-
August 17th, 2004, 02:18 PM
#2
 Originally Posted by paulina_lui
I am trying to print a range of pages using word but have not been able to do that, no matter what.
I am not sure how to pass the paramaters for the page range option, so any suggestions are very much appreciated.
I am calling the print out method like this
Doc.PrintOut(covFalse, // Background.
covOptional, // Append.
covOptional, // Range.
covOptional, // OutputFileName.
covOptional, // // From.
covOptional, // // To.
covOptional, // Item.
COleVariant((long)1), // Copies.
covOptional, // Pages.
covOptional, // PageType.
covOptional, // PrintToFile.
covOptional, // Collate.
covOptional, // ActivePrinterMacGX.
covOptional, // ManualDuplexPrint.
covOptional, // PrintZoomColumn New with Word 2002
covOptional, // PrintZoomRow ditto
covOptional, // PrintZoomPaperWidth ditto
covOptional);
Well this print out fine, but when I try to pass the params for range, it fails, and if I try to use Pages param instead of from/to, then it still prints the whole document.
I have tried passing the range as
VARIANT vName;
vName.vt = VT_BSTR;
vName.bstrVal = SysAllocString(L"WdPrintOutRange.wdPrintFromTo");
and the from/to as (long) 1/(long) 2, but it failed, so then Ipassed the pages options as below
VARIANT vName2;
vName2.vt = VT_BSTR;
vName2.bstrVal = SysAllocString(L"1-2");
But it instead prints the whole doc.
Please help!
Pauli
see http://www.codeguru.com/forum/showpo...9&postcount=13
Verere testudinem! (Fear the turtle)
Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy. -Albert Einstein
Robots are trying to steal my luggage.
-
August 18th, 2004, 07:19 PM
#3
But there is nothing in that link
I could really use some help here!
Thanks!
Pauli
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|