2010-03-04 4 views
2

이 코드는 파워 포인트 addin에 있지만 작동하지 않고 예외가 발생합니다. 예외는 다음과 같습니다 :PowerPoint ExportAsFixedFormat 예외

"값이 예상 범위에 들지 않습니다."

내가 뭘 잘못하고있어?

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 
        ); 

답변

3

마지막 값을 "Missing.Value"로 설정하십시오. MSN 친구 문서에서 http://msdn.microsoft.com/en-us/library/bb231096.aspx

+0

와우, 그게 효과가있다. 나는 PrintRange에 초점을 맞추고 있었다. 감사합니다. 감사합니다. –

+0

@ Alexander Cohen : 닉의 답을 정답임을 나타내는 체크 표시로 선택할 수 있습니다. –

+0

대신 Type.Missing을 사용하십시오. – CantGetANick

1

: http://msdn.microsoft.com/en-us/library/bb231096%28v=office.12%29.aspx

((MSPowerPoint.Presentation)this.Document).SaveAs(filename, MSPowerPoint.PpSaveAsFileType.ppSaveAsPDF, MsoTriState.msoCTrue); 

HIH

+0

프레젠테이션의 미리보기 그림 (.xps 파일 밖)을 사용하기 만하면 NetOffice를 통해 멋지게 작동합니다! ExportAsFixedFormat을 실행하지 못했습니다. –

0

경로 매개 변수가 220 개 문자를 접근 할 때 탁월한 ExportAsFixedFormat 메소드를 호출 때이 오류가있어 그 여기에 사람을했다. Windows의 파일 이름 제한은 260이므로 이상하게 들리지만 파일 이름을 짧게하면 내 문제가 해결됩니다.

관련 문제