tompen78
08-18-2021, 12:23 AM
Hopefully this is a straightforward thing...
I have a combobox in my ppt Add-in that I would like to update with the "Category" document property of the presentation when a new presentation is opened. I'm struggling to get the references to the combobox right (at least I think that is where I am stuck. I have the following code that doesn't do anything:
Sub Auto_Open()
Dim octrl As CommandBarComboBox
Set octrl = CommandBars("CustomTab").FindControl(msoControlComboBox, "Combo1")
octrl.text = "Classified"
End Sub
"CustomTab" is the ID of my add-in and "Combo1" is the ID of my combobox. I have tried also with the labels etc. but have not been able to make it work. Any ideas would be greatly appreciated!
Regards,
I have a combobox in my ppt Add-in that I would like to update with the "Category" document property of the presentation when a new presentation is opened. I'm struggling to get the references to the combobox right (at least I think that is where I am stuck. I have the following code that doesn't do anything:
Sub Auto_Open()
Dim octrl As CommandBarComboBox
Set octrl = CommandBars("CustomTab").FindControl(msoControlComboBox, "Combo1")
octrl.text = "Classified"
End Sub
"CustomTab" is the ID of my add-in and "Combo1" is the ID of my combobox. I have tried also with the labels etc. but have not been able to make it work. Any ideas would be greatly appreciated!
Regards,