G
Gordon
Hi,
I've got some C# code that uses PowerPoint 2007 and tries to save a PPT
file as a PDF file. When I do this from the GUI everything works just fine.
But from C# I get the small "Publishing..." dialog box, and after about the
right amount of time PowerPoint returns control to my program with an error
message that really doesn't help me solve the problem. Here is the code that
that does the work:
powerApp = new Application();
presentation =
powerApp.Presentations.Open(talkInfo.FullName, MsoTriState.msoTrue,
MsoTriState.msoFalse, MsoTriState.msoFalse);
presentation.ExportAsFixedFormat(pdfFile.Name,
PpFixedFormatType.ppFixedFormatTypePDF,
PpFixedFormatIntent.ppFixedFormatIntentPrint,
MsoTriState.msoFalse,
PpPrintHandoutOrder.ppPrintHandoutHorizontalFirst,
PpPrintOutputType.ppPrintOutputSlides,
MsoTriState.msoFalse,
null,
PpPrintRangeType.ppPrintAll,
"",
false,
false,
false,
true,
true,
System.Reflection.Missing.Value);
The error occurs upon return from ExportAsFixedFormat. And the error code
burried in the COM expection is 8004005. I would love to record a macro that
calls this - but I can't find the record macro button in PowerPoint (!?).
Any clues on what I did wrong or how to further debug this would be most
appreciated!
Cheers,
Gordon.
I've got some C# code that uses PowerPoint 2007 and tries to save a PPT
file as a PDF file. When I do this from the GUI everything works just fine.
But from C# I get the small "Publishing..." dialog box, and after about the
right amount of time PowerPoint returns control to my program with an error
message that really doesn't help me solve the problem. Here is the code that
that does the work:
powerApp = new Application();
presentation =
powerApp.Presentations.Open(talkInfo.FullName, MsoTriState.msoTrue,
MsoTriState.msoFalse, MsoTriState.msoFalse);
presentation.ExportAsFixedFormat(pdfFile.Name,
PpFixedFormatType.ppFixedFormatTypePDF,
PpFixedFormatIntent.ppFixedFormatIntentPrint,
MsoTriState.msoFalse,
PpPrintHandoutOrder.ppPrintHandoutHorizontalFirst,
PpPrintOutputType.ppPrintOutputSlides,
MsoTriState.msoFalse,
null,
PpPrintRangeType.ppPrintAll,
"",
false,
false,
false,
true,
true,
System.Reflection.Missing.Value);
The error occurs upon return from ExportAsFixedFormat. And the error code
burried in the COM expection is 8004005. I would love to record a macro that
calls this - but I can't find the record macro button in PowerPoint (!?).
Any clues on what I did wrong or how to further debug this would be most
appreciated!
Cheers,
Gordon.