access macro saved in ppa

A

anonymous

I have written a simple macro in a ppt file. It is accessable via the
Tools->Macro menu.

When I save the ppt as a ppa and load it as an Add-In the macro is nolonger
accessable.

How can I access the macro ?
 
B

Bill Dilworth

Please post the relevant code you used to placing the command button onto
the tool menu.


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
A

anonymous

I attahced the following maco to an object as it's Action Setting.

Sub RemoveImage(oSh As Shape)
oSh.Delete
End Sub

When the ppt is saved as a ppa and loaded as an Add-In the macro
"RemoveImage" is nolonger available. I want to be able to load the Add-In
and have the macro available to any new ppt I create so the macro can be used
as a global Action Setting.
 
B

Bill Dilworth

Ahhhhh.

That is the code that will do the work, but you need to write the code that
will add the command to the tool bar. Look here for how to do that part of
the coding.

***Create an ADD-IN with TOOLBARS that run macros
http://www.pptfaq.com/FAQ00031.htm


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
A

anonymous

OK, code to add command to tool bar written.
But still can't access the RemoveImage as an Action Setting on picture object.
How do I do this ?


Sub RemoveImage(oSh As Shape)
oSh.Delete
End Sub

Sub Auto_Open()
Dim oToolbar As CommandBar
Dim oButton As CommandBarButton
Dim MyToolbar As String
MyToolbar = "RemoveImage Tool"
On Error Resume Next
Set oToolbar = CommandBars.Add(Name:=MyToolbar,
Position:=msoBarFloating, Temporary:=True)
If Err.Number <> 0 Then
Exit Sub
End If
On Error GoTo ErrorHandler
Set oButton = oToolbar.Controls.Add(Type:=msoControlButton)
With oButton
.DescriptionText = "RemoveImage"
.Caption = "RemoveImage"
.OnAction = "RemoveImage"
.Style = msoButtonIcon
.FaceId = 52
End With
oToolbar.Top = 150
oToolbar.Left = 150
oToolbar.Visible = True
NormalExit:
Exit Sub
ErrorHandler:
MsgBox Err.Number & vbCrLf & Err.Description
Resume NormalExit:
End Sub
 
A

anonymous

Thanks, code added.
But how do I add a toolbar menu item to an objects Acion Setting?
 
A

anonymous

I understand now.
Thank you so much.
I'll go with your suggestion (export & import) macros.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top