views:

140

answers:

1

Hello, i have this code in a powerpoint addin but it's not working and giving me an exception. The exception says:

"Value does not fall within expected range".

Any ideas what i'm doing wrong?

this.Application.ActivePresentation.ExportAsFixedFormat(path,
                    PpFixedFormatType.ppFixedFormatTypeXPS,
                    PpFixedFormatIntent.ppFixedFormatIntentPrint,
                    Microsoft.Office.Core.MsoTriState.msoTrue, 
                    PpPrintHandoutOrder.ppPrintHandoutHorizontalFirst,
                    PpPrintOutputType.ppPrintOutputSlides,
                    Microsoft.Office.Core.MsoTriState.msoTrue,
                    null,
                    PpPrintRangeType.ppPrintAll,
                    null,
                    true, 
                    true, 
                    true, 
                    false, 
                    false, 
                    null 
                    );
+1  A: 

Try setting the last value to "Missing.Value". That worked for someone here: http://msdn.microsoft.com/en-us/library/bb231096.aspx

Nick
Wow, that worked. I was focusing on the PrintRange all along. thank you thank you thank you.
Alexander Cohen
@Alexander Cohen: You can select Nick's answer with the checkmark to indicate that it is the correct answer.
Otaku