P
peterfarge
Hallo Usenet,
I have created an AddIn with a commandbar (toolbar) and want to add my
own icons. The problem is that I dont know how to access a slide while
my project is saved as an addin. On the slide lies my icon...
This is the code I'm using to add the toolbar:
Public Sub auto_load()
Dim oComBar As CommandBar
Dim oComBarButton As CommandBarButton
On Error Resume Next
CommandBars("222").Delete
Set oComBar = Application.CommandBars.Add("222")
Set oComBarButton = oComBar.Controls.Add(msoControlButton)
oComBarButton.Style = msoButtonIcon
' Here is the problem:
Presentations("My_Presentation").Slides(1).Shapes("My_Icon").Copy
oComBarButton.PasteFace
oComBar.Visible = True
End Sub
If my project is loaded as an addin, than there is no Presentation
named "My_Presentation". And Application.AddIns(1) has no slides
property. Can anyone help me?
Peter
I have created an AddIn with a commandbar (toolbar) and want to add my
own icons. The problem is that I dont know how to access a slide while
my project is saved as an addin. On the slide lies my icon...
This is the code I'm using to add the toolbar:
Public Sub auto_load()
Dim oComBar As CommandBar
Dim oComBarButton As CommandBarButton
On Error Resume Next
CommandBars("222").Delete
Set oComBar = Application.CommandBars.Add("222")
Set oComBarButton = oComBar.Controls.Add(msoControlButton)
oComBarButton.Style = msoButtonIcon
' Here is the problem:
Presentations("My_Presentation").Slides(1).Shapes("My_Icon").Copy
oComBarButton.PasteFace
oComBar.Visible = True
End Sub
If my project is loaded as an addin, than there is no Presentation
named "My_Presentation". And Application.AddIns(1) has no slides
property. Can anyone help me?
Peter