I have a requirement where I have to extract two lines of text just after the Table of Contents in a Word Document. The text is hidden and added just for use in VBA.
I did some research and found out that I can extract text from a word Document using the Range
object and so I tried hardcoding it and I got the value I wanted by using
MsgBox ActiveDocument.Paragraphs(43).Range.Text
Now this code can work for a specific document but for a new document I don't know where the Table of Contents will end and the exact line number from where I have to extract.
Any help is appreciated and thanks in advance.