Hi
We have a piece of code which performs the following:
- Compares 2 word documents
- Get the revisions from the comparison document
- Open the comparison document using the DocumentBuiler class
- Loop through the revisions collection
- Adds a html tag before each revisions parent node (using the DocumentBuiler class)
- Convert the document to html
This works fine for most documents, however this code fails with document which contains tables.
This is the code we are using
// move to the correct revision node
_documentBuilder.MoveToDocumentStart();
_documentBuilder.MoveTo(_lastRevision.ParentNode);
if (_documentBuilder.CurrentNode != null)
{
// build the html anchor and insert
var insertHtmlAnchor = ......
_documentBuilder.InsertHtml(insertHtmlAnchor);
}
The _documentBuilder.MoveTo(_lastRevision.ParentNode) line fails when the nodetype is of Row
In order to address this I a trying the following
// move to the correct revision node
_documentBuilder.MoveToDocumentStart();
switch (_lastRevision.ParentNode.NodeType)
{
case NodeType.Row:
var row = (Aspose.Words.Tables.Row)_lastRevision.ParentNode;
_documentBuilder.MoveToCell(.....);
break;
default:
_documentBuilder.MoveTo(_lastRevision.ParentNode);
break;
}
if (_documentBuilder.CurrentNode != null)
{
// increment/reset the revision index
_revisionIndex++;
// build the html anchor and insert
var insertHtmlAnchor = ...
_documentBuilder.InsertHtml(insertHtmlAnchor);
}
I don’t know how to get the properties/values in order to perform the following call
case NodeType.Row:
var row = (Aspose.Words.Tables.Row)_lastRevision.ParentNode;
_documentBuilder.MoveToCell(.....);
break;
Please advise how I can call MoveToCell, with the correct parameters for the revision, when its of type Row
Thanks