none
Office ppt文档转化成Xps失败 RRS feed

  • 问题

  • 同一个office文档在office2010环境下转换成xps文件会失败,但是在office 2007环境下转换成功。如果ppt文档中有图片或形状是复制的,在10下转换会失败,在07下转换成功。请问在office2010下如何解决该问题。

    代码如下

    转换代码: Microsoft.Office.Interop.PowerPoint.Application application = null;

                Presentation persentation = null;
                try
                {
                    application = new Microsoft.Office.Interop.PowerPoint.Application();
                    persentation = application.Presentations.Open(pptFilePath, Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoFalse);

                    persentation.ExportAsFixedFormat(xpsFilePath, PpFixedFormatType.ppFixedFormatTypeXPS);
                }

                
    2014年5月30日 7:43

答案

  • 你好:

    转换失败只是一个结果,那么转换的时候报错信息是什么呢?有什么异常产生吗?

    尝试一下其它重载方法,比如以下:

    pptPresentation.ExportAsFixedFormat(
                                                        pExportFilePath,
                                                        PowerPoint.PpFixedFormatType.ppFixedFormatTypeXPS,
                                                        PowerPoint.PpFixedFormatIntent.ppFixedFormatIntentScreen,
                                                        Microsoft.Office.Core.MsoTriState.msoFalse,
                                                        PowerPoint.PpPrintHandoutOrder.ppPrintHandoutVerticalFirst,
                                                        PowerPoint.PpPrintOutputType.ppPrintOutputSlides,
                                                        Microsoft.Office.Core.MsoTriState.msoFalse,
                                                        null,
                                                        PowerPoint.PpPrintRangeType.ppPrintAll,
                                                        string.Empty,
                                                        true,
                                                        true,
                                                        true,
                                                        true,
                                                        false
                                                    );


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年6月2日 8:12
    版主