PowerPoint Printing Problem c# - Nothing gets printed.

Posted by Zeeshan Ahmad on Stack Overflow See other posts from Stack Overflow or by Zeeshan Ahmad
Published on 2009-10-26T10:12:40Z Indexed on 2010/06/03 17:04 UTC
Read the original article Hit count: 233

Filed under:
|
|
|

Guys, i am trying to print powerpoint docs through my windows application in c#. I am using Microsoft.Office.Interop.PowerPoint for this functionality. Following is the code which I have used. It sends the request to printer but nothing gets printed. if you guys have any knowledge plz help.

        string filename = "C:\\test.ppt";
        int copies = 1;
        Microsoft.Office.Interop.PowerPoint.Presentation work = null;
        Microsoft.Office.Interop.PowerPoint.Application app = new Microsoft.Office.Interop.PowerPoint.ApplicationClass();
        Microsoft.Office.Interop.PowerPoint.Presentations presprint = app.Presentations;
        work = presprint.Open(filename, Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoFalse);
        //app.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;
        work.PrintOptions.PrintInBackground = Microsoft.Office.Core.MsoTriState.msoFalse;
        //work.PrintOptions.PrintInBackground = Microsoft.Office.Core.MsoTriState.msoTrue;
        //work.PrintOptions.ActivePrinter = "HP LaserJet 5000 Series PCL6";
        work.PrintOptions.ActivePrinter = app.ActivePrinter;

        work.PrintOut(1, work.Slides.Count, app.ActivePrinter, copies, Microsoft.Office.Core.MsoTriState.msoFalse);


        work.Close();
        app.Quit();`

© Stack Overflow or respective owner

Related posts about c#

Related posts about interop