Quantcast
Viewing all articles
Browse latest Browse all 73760

AX2012 Open and print Office documents

Hi

We want to open and print attached documents with .net classes. Why the open method does not accept the first argument docPath? Any one who has a running example?

Microsoft.Office.Interop.Word.ApplicationClass wordApp;
Microsoft.Office.Interop.Word.DocumentClass wordDoc;
Microsoft.Office.Interop.Word.Documents wordDocs;

System.Type type = System.Type::GetType(
"System.Reflection.Missing");
System.Reflection.FieldInfo info = type.GetField("Value");
System.Object docPath =
"C:\\Daten\\DEV\\Doku\\TestPrint.docx",
objTrue = true,
missing = info.GetValue(
null);

wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();
wordApp.set_ActivePrinter(
"RICOH Aficio MP C2500 PCL 6");
wordDocs = wordApp.get_Documents();
wordDoc = wordDocs.Open(docPath, missing, objTrue, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing );
wordDoc.PrintOut(...);

Thanks for help
Jan


Viewing all articles
Browse latest Browse all 73760

Trending Articles