如何将DocX文档转换为Microsoft.Office.Interop.Word.Document?

时间:2013-02-27 08:38:54

标签: c# c#-4.0 ms-word docx

我想将现有的DocX字词转换或类型转换为Microsoft.Office.Interop.Word.Document。

static DocX g_document;
....
....
function DoSomething()
{
    g_document = DocX.Load(@"C:\Users\RetailWrite.docx");
    Microsoft.Office.Interop.Word.Application wordApp = new  Microsoft.Office.Interop.Word.Application();
    Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Add(g_document); // Here i m getting error
}

然后我想重新键入将Microsoft.Office.Interop.Word归为DocX文档。我该怎么做?

0 个答案:

没有答案