Results 1 to 10 of 10
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Macros for ppt files (97+)

    There was recently a thread about purging speaker notes from a presentation. One of the posters created a macro for this (as well as adding/deleting a toolbar button for the macro) in an add-in. It wasn't clear if the add-in was a choice of his or a necessity.

    My question is whether this is the only way to ensure a macro is available to all presentations. Is there no analog to Word templates or Excel personal.xls where I can store a macro that I want available beyond a single document? If that is the case (which I'm suspecting is the true), is the only thing needed to create an add-in is to save the file as a .ppa? Once that's created, is the only thing still needed to make the add-in available to all files is to go to Tools | Add-ins and add the file.ppa as an add-in? If this is done, then is file.ppa (and its macros) available for all presentations w/o having to add file.ppa each time?

    I tried adding a macro to Blank Presentation.pot and created a new doc based on that but no macro.

    Thanks much.

    Fred

  2. #2
    Lounger
    Join Date
    Jan 2001
    Location
    San Diego, California, USA
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros for ppt files (97+)

    Fred,
    When I made the .ppa and used the 'add-in' feature under tools, it made the .ppa available to all PowerPoint files I open. I recommend you copy/move the .ppa to the proper directory. My directory for a NT workstation is C:WINNTProfilesprofilenameApplication DataMicrosoftAddIns. After that, you should be able to load the .ppa once through PowerPoint and have it available to all presentations from that point on.

    I have found no any other way to do this. I hope this answers you questions.

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Macros for ppt files (97+)

    Ryan,

    Thks for the response.

    When you say
    "When I made the .ppa"
    is all you did was record the macros but then save it as a .ppa type? I didn't see anything in your email on the previous thread to say how you made it.

    Using Tools | Add Ins to make the add-in available to all presentations - that I can handle. In fact, I played with your add-in but had the .ppa on my desktop. When I went to make it available, I browsed to the desktop for it. So I don't think it matters where it is, altho the proper folder is probably where it starts looking.

    I agree - couldn't find any other way to accomplish this, such as is done with other Office apps.

    One other question while I have you: I noticed your add-in also had an Auto_Open and Auto_Close (or similar thing - don't have it on this PC and don't feel like searching now) to add/delete the button from the toolbar. Are these macros, by their name, special as they are in other Office apps? I didn't notice them as events in the ppt VBA environment.

    Thanks.

    Fred

  4. #4
    Lounger
    Join Date
    Jan 2001
    Location
    San Diego, California, USA
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros for ppt files (97+)

    Fred,
    Microsoft article Q222737: http://support.microsoft.com/default.aspx?...b;EN-US;q222737 has the Add-in procedures. The Auto_Open and Auto_Close code you see will either add or remove the Add-in from your drop down tool bar. This is primarily used during the loading and unloading of an Add-in. For example, Unload specifically contains the clean up code to remove the menu item.

    I recommend you read the Microsoft article on PowerPoint Add-ins from the link above.
    Does this shed more light on the topic for you? or do you have more questions?

  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Macros for ppt files (97+)

    Ryan,

    Thks for the pointer. I took a look at the MSKB article. At home now, I only have ppt 97 but I decided to give it a try anyway. Even tho instrucs said it was for ppt 2000, there didn't seem to be anything 2000-specific.

    The MSKB sample worked in 97 also. The menu item got added at the top of the Tools menu.

    It's not clear why the file has to be saved both as a ppt and a ppa. It seems the VBA code is stored in the ppt version (I'll call these cv.ppt and cv.ppa)
    - I get the "macro warning" when opening cv.ppt
    - I can view the code in the VBE when opening the cv.ppt but not when opening any other ppt or the cv.ppa version; this corresponds to that I only see the macros under Tools | Macros when I have the cv.ppt version open but not if this isn't open

    So it's unclear what the cv.ppa does. It also seems this creates some kind of 1-1 relationship between the cv.ppt file (where the code seems to live) and the cv.ppa file. Even tho I created the cv.ppt and the cv.ppa files with the same file name, that doesn't seem to matter - I renamed the cv.ppt file to cv-x.ppt and things still worked OK. I assume I can't rename the cv.ppa file since that file name is part of what PowerPoint keeps track of when adding a new add-in.

    While things seem to work as I want (code available for all presentations), it's not clear why and what the linkages are between the cv.ppt and the cv.ppa.

    I'll give it a try when I'm back in the office where I have Office 2000.

    Thks again. Any further clarifications on above would be appreciated.

    Fred

  6. #6
    Lounger
    Join Date
    Jan 2001
    Location
    San Diego, California, USA
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros for ppt files (97+)

    Fred,

    From what I understand, which is not much, the success of the macro to ppa process within PowerPoint is enabled thru the "save as" function. I know that the macro codes must first exist in a blank ppt file and that there is some sort of conversion that occurs when morphing the ppt to ppa. It appears to me that some inheritance issues are at play. I am not certain. I just know that this process works and I will have to obey Microsoft in the design and implementation of ppa's.

    Maybe other Loungers or moderators have the answer you seek.

  7. #7
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Macros for ppt files (97+)

    You save it as a .ppa file so that you can use it as an add-in.
    You save it as a .ppt file so that you can edit it again in the future.

    It's a bit like keeping your code sources as well as the final compiled version.

    StuartR

  8. #8
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Macros for ppt files (97+)

    Hi Stuart,

    Well, this makes sense - in a Microsoft kind of way. Why do it like the other office applications?

    Anyway, what you said implies the following:
    - code exists in the ppa but is not visible (it's "compiled")
    - there is no relationship between the ppa and the ppt in terms of names (I was able to change the name of the ppt w/o affecting the ability to use the ppa that had been created)
    - if I change the ppt, I have to save that and then save the ppa again

    Thanks.

    Fred

  9. #9
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Macros for ppt files (97+)

    Fred, unfortunately, PowerPoint doesn't have any feature analogous to Personal.xls or Normal.dot, so there's not a convenient place to stash a macro toolbox. I think that the easiest way is to have an empty presentation with all of your macro tools in it. You can open it up, switch back to your presentation, and then run any macro that is in your toolbox. Note, that after you choose the tools, macro menu, you will need to change the
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  10. #10
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Macros for ppt files (97+)

    Hi Sammy,

    Thks much. I think the msg I've gotten from the rest of this thread (not sure if you saw it since you responded to my orig post) is to create a ppa that kind of acts like personal.xls. It's not quite the same - you have to tell ppt about the ppa (kind of like a Word global template). But once you've created or modified your ppa and told ppt about it, it's automatically loaded at load time and the macros can be available. Unfortunately your macros are not directly available from Tools | Macro but your ppa can add, thru an Auto_Open macro, menu items representing the macros you want to have. I've tried it and it works. Way to go for ppt.

    Fred

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •