G
Guest
Using C++ .NET 2003 and the Office XP PIA (Primary Interop Assemblies) I am
trying
to manipulate word documents. My attempt to print from a
Interop::Word::_Document in C++ .NET looks as follows...
Object * background = Reflection::Missing::Value;
Object * append = Reflection::Missing::Value;
Object * range = Reflection::Missing::Value;
Object * outputFileName = Reflection::Missing::Value;
Object * from = Reflection::Missing::Value;
Object * to = Reflection::Missing::Value;
Object * item = Reflection::Missing::Value;
Object * copies = Reflection::Missing::Value;
Object * pages = Reflection::Missing::Value;
Object * pageType = Reflection::Missing::Value;
Object * printToFile = Reflection::Missing::Value;
Object * collate = Reflection::Missing::Value;
Object * fileName = Reflection::Missing::Value;
Object * activePrinterMacGX = Reflection::Missing::Value;
Object * manualDuplexPrint = Reflection::Missing::Value;
Object * printZoomColumn = Reflection::Missing::Value;
Object * printZoomRow = Reflection::Missing::Value;
Object * printZoomPaperWidth = Reflection::Missing::Value;
Object * printZoomPaperHeight = Reflection::Missing::Value;
DataDoc->PrintOut(&background, &append, &range, &outputFileName,
&from, &to, &item, &copies,
&pages, &pageType,
&printToFile, &collate,
&activePrinterMacGX,
&manualDuplexPrint,
&printZoomColumn,
&printZoomRow,
&printZoomPaperWidth,
&printZoomPaperHeight);
With all the Objects set to Reflection::Missing::Value the document DOES
print to my default printer. If I put in a file name to
send the printout to a
file that also works. Object * fileName = S"C:\\Output";
However, whenever I try to change the 'copies' Object pointer from
Reflection::Missing::Value to printout 2 copies, it fails. I
usually
get some sort of "Type Mismatch"
Or if I want to set any other appropriate variable to true, it also fails.
How do I get a '2' or a 'true' to an Object reference so
that this method
works. How do you send a value to the Interop in C++ .NET?
I believe I
am missing something simple. Thanks in advance for any ideas!
trying
to manipulate word documents. My attempt to print from a
Interop::Word::_Document in C++ .NET looks as follows...
Object * background = Reflection::Missing::Value;
Object * append = Reflection::Missing::Value;
Object * range = Reflection::Missing::Value;
Object * outputFileName = Reflection::Missing::Value;
Object * from = Reflection::Missing::Value;
Object * to = Reflection::Missing::Value;
Object * item = Reflection::Missing::Value;
Object * copies = Reflection::Missing::Value;
Object * pages = Reflection::Missing::Value;
Object * pageType = Reflection::Missing::Value;
Object * printToFile = Reflection::Missing::Value;
Object * collate = Reflection::Missing::Value;
Object * fileName = Reflection::Missing::Value;
Object * activePrinterMacGX = Reflection::Missing::Value;
Object * manualDuplexPrint = Reflection::Missing::Value;
Object * printZoomColumn = Reflection::Missing::Value;
Object * printZoomRow = Reflection::Missing::Value;
Object * printZoomPaperWidth = Reflection::Missing::Value;
Object * printZoomPaperHeight = Reflection::Missing::Value;
DataDoc->PrintOut(&background, &append, &range, &outputFileName,
&from, &to, &item, &copies,
&pages, &pageType,
&printToFile, &collate,
&activePrinterMacGX,
&manualDuplexPrint,
&printZoomColumn,
&printZoomRow,
&printZoomPaperWidth,
&printZoomPaperHeight);
With all the Objects set to Reflection::Missing::Value the document DOES
print to my default printer. If I put in a file name to
send the printout to a
file that also works. Object * fileName = S"C:\\Output";
However, whenever I try to change the 'copies' Object pointer from
Reflection::Missing::Value to printout 2 copies, it fails. I
usually
get some sort of "Type Mismatch"
Or if I want to set any other appropriate variable to true, it also fails.
How do I get a '2' or a 'true' to an Object reference so
that this method
works. How do you send a value to the Interop in C++ .NET?
I believe I
am missing something simple. Thanks in advance for any ideas!