After adding macros and add-ins, there is multiple duplicated comm

A

Alicia

I have try adding a macro ("FilenameinFooter") in PPT. to update file path
automatically.
The macro is running fine and i add it as a add-in in powerpoint.

But now under my tools menu there is 20 commands that says "FilenameinFooter"

Does anyone know the cause of the problem, and revert it back to one command
only?

I have attached the writing of the macros below. Please help, Many Thanks


Dim FooterText As String


' And set it to the current presentation's full path/name
FooterText = ActivePresentation.FullName
' or if you prefer just the name use
' FooterText = ActivePresentation.Name


If ActivePresentation.HasTitleMaster Then
With ActivePresentation.TitleMaster.HeadersFooters
With .Footer
..Text = FooterText
..Visible = msoTrue
End With
End With
End If


With ActivePresentation.SlideMaster.HeadersFooters
With .Footer
..Text = FooterText
..Visible = msoTrue
End With
End With


End Sub
Sub Auto_Open()

Dim NewControl As CommandBarControl

' Store an object reference to a command bar.
Dim ToolsMenu As CommandBars

' Figure out where to place the menu choice.
Set ToolsMenu = Application.CommandBars

' Create the menu choice. The choice is created in the first
' position in the Tools menu.
Set NewControl = ToolsMenu("Tools").Controls.Add _
(Type:=msoControlButton, _
Before:=1)

' Name the command.
NewControl.Caption = "FilenameInFooter"

' Connect the menu choice to your macro. The OnAction property
' should be set to the name of your macro.
NewControl.OnAction = "FilenameInFooter"

End Sub
 
C

Chirag

Change the line where you are adding the new control to:

---
Set NewControl = ToolsMenu("Tools").Controls.Add _
(Type:=msoControlButton, _
Before:=1, Temporary:=True)
---

Make the control as temporary so that PowerPoint would not retain it when it
is closed and reopened.

- Chirag

PowerShow - View multiple shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
S

Shyam Pillai

Alicia,
In addition to what Chirag said, to get rid of the exisiting duplicate menu
items:
1. Select Tools | Customize
2. Click on Tools | FilenameInFooter, drag and drop it onto the customize
window
3. Repeat to get rid of all the mulitple items.
4. Close the customize window.
 
A

Alicia

Thanks a lot Chirag and Shyam,
I managed to remove the duplicate macros and re-attached the modified macros.
Thanks a zillion
Alicia
 

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