Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / June 2007

Tip: Looking for answers? Try searching our database.

access macro saved in ppa

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
anonymous@microsoft.com - 09 Jun 2007 12:03 GMT
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 ?
Bill Dilworth - 10 Jun 2007 23:15 GMT
Please post the relevant code you used to placing the command button onto
the tool menu.

Signature

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
.

>I have written a simple macro in a ppt file.  It is accessable via the
> Tools->Macro menu.
[quoted text clipped - 4 lines]
>
> How can I access the macro ?
anonymous@microsoft.com - 11 Jun 2007 00:25 GMT
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.

> Please post the relevant code you used to placing the command button onto
> the tool menu.
[quoted text clipped - 7 lines]
> >
> > How can I access the macro ?
Bill Dilworth - 11 Jun 2007 00:51 GMT
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

Signature

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
.

>I attahced the following maco to an object as it's Action Setting.
>
[quoted text clipped - 19 lines]
>> >
>> > How can I access the macro ?
anonymous@microsoft.com - 11 Jun 2007 05:30 GMT
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

> Ahhhhh.
>
[quoted text clipped - 28 lines]
> >> >
> >> > How can I access the macro ?
Steve Rindsberg - 11 Jun 2007 23:41 GMT
> I attahced the following maco to an object as it's Action Setting.
>
> Sub RemoveImage(oSh As Shape)
>     oSh.Delete
> End Sub

Ah, that's different I'm afraid.  

Run Macro actions can only access macros in the current presentation.

Given what you're trying to do, it'd make a lot of sense if you could also use
macros in an addin from any presentation, but you can see why MS might have
restricted it the way they have;  your action settings would all break on any
computer that doesn't have your add-in installed.

The best workaround I can suggest is to put all your macros into a single
module, test them carefully, then export the module.  Then you can import it
into any other presentation quickly and easily.

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
anonymous@microsoft.com - 12 Jun 2007 04:51 GMT
I understand now.
Thank you so much.
I'll go with your suggestion (export & import) macros.

> > I attahced the following maco to an object as it's Action Setting.
> >
[quoted text clipped - 20 lines]
> PPTools:  www.pptools.com
> ================================================
Steve Rindsberg - 11 Jun 2007 04:58 GMT
> 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.

You'll want to create a toolbar or menu item to fire your macros.  Some of the
entries here will help with that:

Creating and Installing Add-ins, Toolbars, Buttons
http://www.pptfaq.com/index.html#name_Creating_and_Installing_Add-ins-_Toolbars
-_Buttons

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
anonymous@microsoft.com - 11 Jun 2007 21:50 GMT
Thanks,  code added.
But how do I add a toolbar menu item to an objects Acion Setting?

> > I have written a simple macro in a ppt file.  It is accessable via the
> > Tools->Macro menu.
[quoted text clipped - 14 lines]
> PPTools:  www.pptools.com
> ================================================
Steve Rindsberg - 11 Jun 2007 23:50 GMT
> Thanks,  code added.
> But how do I add a toolbar menu item to an objects Acion Setting?

See my other reply ... I suspect you can't do what you're after.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.