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
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