简体   繁体   中英

Save existing Docx as XML using c#

i have an existing word document (office 2010) and want to programatically saveAs it as XML. i was tried

   Microsoft.Office.Interop.Word.Application.Documents.Open(@"C:\Test\NewDocument.docx");

but its not correct.

how can i do this?

var myfile= @"C:\Test\NewDocument.docx"; 
var fileInfo = new FileInfo(myfile); 
fileInfo.MoveTo(Path.ChangeExtension(myfile, ".xml"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM