Document.PrintOut2000()

R

Rahul

HI,

I am trying to convert a word document into pdf using the code below. If i provide the OutputFileName i.e. is my oDestinationPath then the word document is converted to the pdf, but when i try to open the same i get a message "Acrobat could not open '_h0071.pdf' because it is either not a supported file type or because the file has been corrupted". Although if I provide oMissing to the OutPutFileName then the file is created on the desktop and opens fine. I want to control where the file is placed.

object oDestPath = @"c:\ZZZZ\_h0071__.pdf";
wordApp.ActivePrinter = "Acrobat Distiller";

// Print
wordApp.ActiveDocument.PrintOut2000(ref oBackground, ref oMissing, ref oMissing, ref oDestPath, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing);


Please tell me what am i doing wrong.

Thanks in advance
Rahul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top