Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    552
    Thanks
    0
    Thanked 1 Time in 1 Post

    Another add-in question (Powerpoint 2002)

    I just read all the post for the add-in question. Mine is a little simpler. I have several macros in a ppt. I save it as a .ppa and it puts it in the right folder. Then i open a new presentation, use the add-in manager, check it, and click OK. I don't have access to the macros, they are not there. My security is set to LOW and nothing else seems amiss. Do i have to change something in my registry to make the maros available to other ppt's?

  2. #2
    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: Another add-in question (Powerpoint 2002)

    JHA,

    From what I have seen, macros that are part of an add-in are NOT available thru the Tools | Macro command. The add-in itself is also NOT visible in the ppt VBE (at least from what I've seen in ppt 97 and 2000; can't speak to 2002 but would think it's the same).

    Since you read the other thread, which I started, you'll see one of Gary Frieder's responses that included links to 2 MS KB articles. The one on Q222737, if I recall correctly, shows another piece that is necessary: you need an AutoOpen and AutoClose macro as part of your add-in. The sole job of these is to add/remove buttons somewhere on a menu/toolbar so you can activate the macros (the ones that do the real work) from within ppt. The Q222737 article shows how to add these under the Tools menu on the main menu. I preferred to create a new main menu item called "Fred's Add-Ins" and put buttons on that menu. My reasoning was that by "hiding" the buttons under Tools, you might forget they were there. In your case, if you have a few "real" macros, you might want a "JHA's Add-Ins" and put buttons under there.

    Also, you don't really need an AutoClose if your Auto-Open checks to see if the menu items are already present. If you don't do this check, then you'll end up with duplicate items. All will activate the same macros but you may run out of room on your toolbar/menu bar. So it's probably safer to use both.

    Lastly, since I had not played much with ppt VBA, it was not immediately obvious to me how to add a new main menu item. I did finally struggle thru that. My code for AutoOpen and AutoClose could probably use a little cleaning up. If you need the code, I can post that. If you clean it up, I'd appreciate another posting. For example, one could check, in AutoOpen, the main menu bar to see if the "xxx's Add-Ins" item is there; similarly for the items within the "xxx Add-Ins" menu (assuming the main item existed).

    HTH.

    Fred

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    552
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Another add-in question (Powerpoint 2002)

    thanks for the info. Yes, please post your code and i will work with it and send u what i find out. thanks

  4. #4
    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: Another add-in question (Powerpoint 2002)

    JHA,

    Here's the code for AutoOpen and AutoClose:

    <pre>Option Explicit

    Sub Auto_Open()
    '
    Dim BarsCollection As CommandBars
    Dim NewMBItem As CommandBarControl, NewSubMenuItem As CommandBarControl
    Dim MBControlsCount As Integer

    Set BarsCollection = Application.CommandBars
    MBControlsCount = BarsCollection("Menu Bar").Controls.Count

    'create new menu item called "Add-Ins" for Menu Bar
    Set NewMBItem = BarsCollection("Menu Bar").Controls.Add(Type:=msoControlPopup, _
    Before:=MBControlsCount + 1)
    NewMBItem.Caption = "Fred's AddIns"

    'create subitem on Add-Ins menu
    Set NewSubMenuItem = NewMBItem.Controls.Add(Type:=msoControlButton, Before:=1)
    NewSubMenuItem.Caption = "Add Notes Index"
    NewSubMenuItem.OnAction = "AddNotesIndex" 'refers to dummy sub below
    End Sub

    Sub Auto_Close()
    '
    Dim MBItem As CommandBar, MBControl As CommandBarControl

    'Get an object reference to the Menu Bar
    Set MBItem = Application.CommandBars("Menu Bar")

    'Loop through the commands on the tools menu
    For Each MBControl In MBItem.Controls

    'Check to see whether the menu item exists
    If MBControl.Caption = "Fred's AddIns" Then
    'if want to remove just "Add Notes Index", need another loop
    MBControl.Delete
    End If

    Next MBControl

    End Sub

    Sub AddNotesIndex()
    '
    'this is your routine that does the real work

    End Sub

    </pre>



    HTH. Post back if you make any improvements.

    Fred

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Another add-in question (Powerpoint 2002)

    > macros that are part of an add-in are NOT available thru the Tools | Macro command

    Thank you! I was puzzled! (PPT97/SR2)

Posting Permissions

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