- Joined
- Apr 23, 2008
- Messages
- 1
- Reaction score
- 0
Hi,
I hope somebody can help me. I'm currently learning .NET and I'm trying to create my first Office COM add-in in C#, and need a way to parse the output of applicationObject.Selection.WordOpenXML to return only the current selection, as it currently returns an entire OpenXML package.
Put simply, I need to parse the XML string that WordOpenXML creates, and once I see a <w:body> tag, begin writing output to a second string until the closing </w:body> tag.
I think I need to use the System.IO.StringReader within XMLReader, but i'm unsure how to actually find the node I require and then output an unmodified string until the close tag.
Thanks,
Matthew
I hope somebody can help me. I'm currently learning .NET and I'm trying to create my first Office COM add-in in C#, and need a way to parse the output of applicationObject.Selection.WordOpenXML to return only the current selection, as it currently returns an entire OpenXML package.
Put simply, I need to parse the XML string that WordOpenXML creates, and once I see a <w:body> tag, begin writing output to a second string until the closing </w:body> tag.
I think I need to use the System.IO.StringReader within XMLReader, but i'm unsure how to actually find the node I require and then output an unmodified string until the close tag.
Thanks,
Matthew