Powerpoint interop error

  • Thread starter akshar108 via DotNetMonster.com
  • Start date
A

akshar108 via DotNetMonster.com

TextFrame (unknown member) : Invalid request. This type of shape cannot have
a TextRange

i got this error while i m fetching text from textframe which is in the slide

my code is following can any one help me to get all text from slide

For Each pptSlide In pptDoc.Slides

shapes1 = pptSlide.Shapes
For j As Integer = 1 To shapes1.Count

tf = shapes1.Item(j).TextFrame
If TypeOf tf.TextRange Is PowerPoint.TextRange Then
If Not tf.TextRange Is Nothing Then
str1 += tf.TextRange.Text + " "
End If

Else
If TypeOf shapes1.Item(j) Is PowerPoint.Table
Then
Dim dt As PowerPoint.Table = shapes1.Item(j)

'For Each tShape As PowerPoint.Shape In dt.
Rows.Count

' If tShape.TextFrame IsNot Nothing Then
' str1 += tShape.TextFrame.TextRange.
Text + " "
' End If
'Next
For i As Integer = 0 To dt.Columns.Count
For t As Integer = 0 To dt.Rows.Count
str1 += dt.Cell(t, i).Shape.TextFrame.
TextRange.Text
Next
Next
End If
End If
Next
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top