Hi,
I use Aspose.Words for .NET 15.12.0 to parse document and look for Heading 1 text with certain content. So, I use this code:
Dim paragraphs as NodeCollection = myDoc.GetChildNodes(NodeType.Paragraph, True)
For Each p as Paragraph in paragraphs
If p.ParagraphFormat.Style.Name = “Heading 1” Then
If p.ToTxt = “MY SEARCH” Then
…
In Visual Studio, I have message say “ToTxt is obsolete. Use ToString(SaveFormat.Text) instead”. I replace ToText with ToString(SaveFormat.Text), but it returns “Aspose.Words.Paragraph” instead of the heading content (like “MY SEARCH”). Is this a bug or I use the method ToString(…) incorrectly? On the other hand, ToTxt returns the heading content correctly (like “MY SEARCH” ) even though it says it’s obsolete.
Thanks