G
Guest
Powerpoint with Office 2003
Is this possible. I've combed the net and MSDN and all instances of
populating a combo box list seem to work only when you manually "Edit" the
shape after creating it. When attempting to do it through the vba code that
is creating the combo box, I can't get it to work.
I've tried variations of creating the box. This, below, is my last one. I
can't find a way for the code to recognize the additem method. I only had
luck manually entering it into the code change event for the newly created
combo box.
I guess the question might be, can you, with VBA, create a sub procedure
when creating the combo box?
*******************
Public Sub AddPPTComboBox(app As PowerPoint.Application, dblLeft As Double,
dbltop As Double, dblWidth As Double, dblheight As Double, strname As String)
On Error GoTo errhandler
Dim shp As Object
Set shp =
app.ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=dblLeft, _
Top:=dbltop, Width:=dblWidth, Height:=dblheight,
ClassName:="Forms.ComboBox.1", Link:=msoFalse)
Exit Sub
errhandler:
MsgBox Err.Number & ": " & Err.Description, , "AddPPTComboBox"
End Sub
***************************
Matthew Mark
Is this possible. I've combed the net and MSDN and all instances of
populating a combo box list seem to work only when you manually "Edit" the
shape after creating it. When attempting to do it through the vba code that
is creating the combo box, I can't get it to work.
I've tried variations of creating the box. This, below, is my last one. I
can't find a way for the code to recognize the additem method. I only had
luck manually entering it into the code change event for the newly created
combo box.
I guess the question might be, can you, with VBA, create a sub procedure
when creating the combo box?
*******************
Public Sub AddPPTComboBox(app As PowerPoint.Application, dblLeft As Double,
dbltop As Double, dblWidth As Double, dblheight As Double, strname As String)
On Error GoTo errhandler
Dim shp As Object
Set shp =
app.ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=dblLeft, _
Top:=dbltop, Width:=dblWidth, Height:=dblheight,
ClassName:="Forms.ComboBox.1", Link:=msoFalse)
Exit Sub
errhandler:
MsgBox Err.Number & ": " & Err.Description, , "AddPPTComboBox"
End Sub
***************************
Matthew Mark