I am using Aspose.Word’s DocumentVisitor class to read a word document. I am using VisitParagraphStart function to go through each paragraph one by one. Now, my problem is that I need to get the Format and indentation level of the current paragraph I am in. Can you please show me or point me to an article that can shows how can I do this?
Here is the example of what I want to do:
Public Overrides Function VisitParagraphStart(ByVal paragraph As Aspose.Words.Paragraph) As Aspose.Words.VisitorAction
'Get the Font Name of current Paragraph.
'Get the Font Size of current paragraph.
'Get the Font Style (B/I/U) of current Paragraph
'Get the Indentation Level of current Paragraph
Thanks very much in advance.
Thanks for your request. You can try to use ParagraphFormat class to get these values. See the following link for more information.
// Get the Font Name of current Paragraph.
// Get the Font Size of current paragraph.
// Get the Font Style (B/I/U) of current Paragraph
if (paragraph.ParagraphFormat.Style.Font.Underline != Underline.None)
// is Underlined
// Get the Indentation Level of current Paragraph
I hope that it will help you.