Saravanan
Saravanan

Reputation: 11602

how to get the text in shapes or picture in word document using Microsoft.Office.Interop.Word?

My word file containing list of paragraphs and images and shapes.Here, Some pictures(images) are grouped itself. And each group having one text box control with some text.The Shapes are also having the text i mentioned above.

Using Microsoft.Office.Interop.Word.Paragraphs, i can able to get the paragraph text.But Could not able to get the those text.How can i get it.

In Open Xml representation, All text are inside the <w:p>.

Please guide me to get out of this issue...

Saravanan.P

Upvotes: 1

Views: 2434

Answers (1)

donya
donya

Reputation: 11

You can use of "HasText" property for this to work.

if (FileDocument.Shapes.Range(1).TextFrame.HasText != 0)
{
    Fieldstring.Add(FileDocument.Shapes.Range(1).TextFrame.TextRange.Text.ToString());
}

Upvotes: 1

Related Questions