lundi 27 avril 2015

c# powerpoint interop how do I print horizontally?


The MSDN is making me crazy. I succeeded on printing four pages at a single page, but can't find the option to change it print horizontally. By default, it is printed vertically, not that good looking.

   public void test6()
    {
        try
        {
            Microsoft.Office.Interop.PowerPoint.Application varPPT = new Microsoft.Office.Interop.PowerPoint.Application();
            Microsoft.Office.Interop.PowerPoint.Presentation varPre = varPPT.Presentations.Open(filePath, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse);

            varPre.PrintOptions.OutputType = Microsoft.Office.Interop.PowerPoint.PpPrintOutputType.ppPrintOutputFourSlideHandouts;

            varPre.PrintOut();


        }
        catch (Exception varE)
        {
            MessageBox.Show("Error:\n" + varE.Message, "Error message");
        }
    }

Well, this is my code. It prints well vertically, but that's not good looking at all.

I thought

varPre.PrintOptions.HandoutOrder = Microsoft.Office.Interop.PowerPoint.PpPrintHandoutOrder.ppPrintHandoutHorizontalFirst;

might do the job, but it doesn't seem to fit at all.

Does anyone knows the method or property for this?


Aucun commentaire:

Enregistrer un commentaire