W
Wayne
I am new at VBA and trying to use VBA in powerPoint 2007 in a vista os
to create a quiz. I am reading a set of question into an array of
questions from a file and want to add one question at a time to a text
box. I am using the following code:
ActivePresentation.Slides(5).Shapes("TextBox
19").TextFrame.TextRange.Text = question(number)
but I have been getting the following error:
Run-time error '-2147188160 (80048240)':
Item TextBox 19 not found in the Shapes collection.
But when I check the object code using either the selection and
visibility option in powerPoint or the code from example 8 from David
Marcovitz
Public Sub GetObjectName()
If ActiveWindow.Selection.Type = ppSelectionShapes _
Or ActiveWindow.Selection.Type = ppSelectionText Then
If ActiveWindow.Selection.ShapeRange.Count = 1 Then
MsgBox (ActiveWindow.Selection.ShapeRange.Name)
Else
MsgBox ("You have selected more than one shape.")
End If
Else
MsgBox ("No shapes are selected.")
End If
End Sub
I get that the object name is TextBox 19.
Please Help
to create a quiz. I am reading a set of question into an array of
questions from a file and want to add one question at a time to a text
box. I am using the following code:
ActivePresentation.Slides(5).Shapes("TextBox
19").TextFrame.TextRange.Text = question(number)
but I have been getting the following error:
Run-time error '-2147188160 (80048240)':
Item TextBox 19 not found in the Shapes collection.
But when I check the object code using either the selection and
visibility option in powerPoint or the code from example 8 from David
Marcovitz
Public Sub GetObjectName()
If ActiveWindow.Selection.Type = ppSelectionShapes _
Or ActiveWindow.Selection.Type = ppSelectionText Then
If ActiveWindow.Selection.ShapeRange.Count = 1 Then
MsgBox (ActiveWindow.Selection.ShapeRange.Name)
Else
MsgBox ("You have selected more than one shape.")
End If
Else
MsgBox ("No shapes are selected.")
End If
End Sub
I get that the object name is TextBox 19.
Please Help