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