8,731
社区成员
发帖
与我相关
我的任务
分享
public delegate bool Word2XpsDelegate(string sourcePath, string targetPath, Microsoft.Office.Interop.Word.WdExportFormat exportFormat);
………………
………………
FileInfo fif = new FileInfo(this.GetFilePath());
if (fif.Extension == ".doc" || fif.Extension == ".docx")
{
Word2XpsDelegate del = new Word2XpsDelegate(Word2Xps.Convert);
del.BeginInvoke(fif.FullName, fif.DirectoryName + "\\" + fif.Name.Substring(0, fif.Name.LastIndexOf(".")) + ".xps", Microsoft.Office.Interop.Word.WdExportFormat.wdExportFormatXPS, null, null);
}