2009-04-27 50 views

回答

2

这里有一个职位由埃里克·怀特展示了如何删除评论:http://blogs.msdn.com/ericwhite/archive/2008/07/14/using-the-open-xml-sdk-and-linq-to-xml-to-remove-comments-from-an-open-xml-wordprocessing-document.aspx

总之这里是他发表的代码:

XName commentRangeStart = w + "commentRangeStart"; 

XName commentRangeEnd = w + "commentRangeEnd"; 

XName commentReference = w + "commentReference"; 

mainDocumentXDoc.Descendants() 

    .Where(x => 

     x.Name == commentRangeStart || 

     x.Name == commentRangeEnd || 

     x.Name == commentReference) 

    .Remove(); 
4

如何如下:

ActiveWindow.View.RevisionsView = wdRevisionsViewFinal 
ActiveWindow.View.ShowRevisionsAndComments = False 

这将显示没有标记的最后文件。

注:的ActiveWindow是一个Word.Application类的属性

编辑:

这个答案是使用OLE自动化,重读你的问题,这可能不是你在找什么,对不起。

+0

虽然,这是很好的知道和解决我的特殊问题。 – M463 2016-08-02 09:39:26

0

开/关修订切换通过ActiveDocument.TrackRevisions设置真假。

相关问题