简体   繁体   English

使用 c# 将现有的 Docx 保存为 XML

[英]Save existing Docx as XML using c#

i have an existing word document (office 2010) and want to programatically saveAs it as XML.我有一个现有的 Word 文档(office 2010),并希望以编程方式将其另存为 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"));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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