I think that makes things a little bit clearer (slight error in the snippet with the shape.NodeType not being needed).
Can you help me with respect to the paragraph and runs? The original code was part of a much larger test code I was working on with getting the Text from inside a document that matches a certain condition. Say I want to remove all the text in a document that is written in red, what’s the best way to approach it? I need it removed from all Sections, Header/Footers, Tables and TextAreas.
I had been looping through the body paragraphs, then the header/footer paragraphs, then the tables cell paragraphs. I’m wonder if I can run the GetChildNodes across the whole document in one sweep for Paragraphs? Then use the runs to determine the font color? Or just look for all runs?
Would “wordDocument.GetChildNodes(NodeType.Run, true)” do all the above (Sections, Header/Footers, Tables and TextAreas)? Then check run.Font.Color and if red use run.Remove()? e.g:
Aspose.Words.RunCollection runCollection = wordDocument.GetChildNodes(NodeType.Run, true) as Aspose.Words.RunCollection;
for (Int32 i = runCollection.Count - 1; i>= 0; iû)
Aspose.Words.Run run = runCollection[i];
if (run.Font.Color.R == 255 && run.Font.Color.G == 0 && run.Font.Color.B == 0)