admin管理员组

文章数量:1593159

//要先引用word控件

//不存在文件夹,建立该文件夹,否则word将会出错
string path3 = @“C:\Windows\SysWOW64\config\systemprofile\Desktop”;
if (!Directory.Exists(path3))
{
Directory.CreateDirectory(path3);
}

//转换
string path = @“C:\Users\wiseyao\Desktop\22.pdf”;
string path2 = @“C:\Users\wiseyao\Desktop\22.docx”;
MSWord.Application app = new MSWord.Application();
//MSWord.Application app = new MSWord.ApplicationClass();
MSWord.Document doc=app.Documents.Open(path,Visible:false);
doc.SaveAs2(path2, MSWord.WdSaveFormat.wdFormatXMLDocument);
//app.Visible = true;

本文标签: 控件wordPDF