Note that there are some explanatory texts on larger screens.

plurals
  1. POpower point printing problem using C#
    primarykey
    data
    text
    <p>I'm using the COM objects from Office 2007 to handle and print ms-office files. I don't have any problems with word and excel documents, but i just can't print Power Point docs.</p> <p>the code bellow just opens the file send a job to the printer but nothing gets printed</p> <p>what am i doing wrong? =(</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Main { class PrintPPoint { public static void PrintPPointDocument(string filename, int copies, string range) { 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; //app.Visible = Microsoft.Office.Core.MsoTriState.msoTrue; work = presprint.Open(filename, Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoFalse); work.PrintOptions.PrintInBackground = 0; work.PrintOptions.ActivePrinter = app.ActivePrinter; if (range.Equals("0")) { work.PrintOut(0, 1, app.ActivePrinter, copies, Microsoft.Office.Core.MsoTriState.msoFalse); } else { string[] toprintsheet = range.Split(new char[] { ',' }); foreach (string aux in toprintsheet) { work.PrintOptions.PrintInBackground = 0; work.PrintOptions.ActivePrinter = app.ActivePrinter; if (aux.Contains("-")) { int from = 0, to = 0; string[] SplitRange = aux.Split(new char[] { '-' }); from = Convert.ToInt16(SplitRange[0]); to = Convert.ToInt16(SplitRange[1]); work.PrintOut(from, to, app.ActivePrinter, 1, Microsoft.Office.Core.MsoTriState.msoFalse); } else { work.PrintOut(Convert.ToInt16(aux), Convert.ToInt16(aux), app.ActivePrinter, copies, Microsoft.Office.Core.MsoTriState.msoFalse); } } } work.Close(); app.Quit(); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload