2009-04-27 4 views

Répondre

2

Voici un message par Eric White qui montre comment supprimer les commentaires: 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

En bref, voici le code qu'il a publié:

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

Que diriez-vous les éléments suivants:

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

Cela montrera le document final sans majoration.

Note: ActiveWindow est une propriété de la classe Word.Application

EDIT:

Cette réponse utilise OLE Automation, sur votre question relisant ce ne peut pas être ce que vous cherchez, désolé.

+0

Même si c'est bon à savoir et résolu mon problème particulier. – M463

0

Activer/désactiver le suivi des modifications par la mise ActiveDocument.TrackRevisions à Vrai faux.

Questions connexes