This example creates a DocumentIterator instance for the current document and calls its MoveNext method to iterate through document elements. The Visitor pattern is implemented to process a document element.
MyVisitor is a custom class, which implements the IDocumentVisitor interface. This class provides a method that processes DocumentText elements, obtains a name of the font applied to the text element, and writes the font name in a list.
See also: How to use the Document Iterator object to iterate over document elements.