Overriding the default menu item functionality.

A

arjunmenon03

Hi,

We have a Word Add-in, which overrides SaveAs menu item and also adds
a new menu item. When the new menu item is clicked the following code
will be executed.

Dim objSaveAs As CommandBarButton
Set objSaveAs = objApplication.CommandBars("File").FindControl
(Id:=748) ' 748 - SaveAs Id
objSaveAs.Execute

File-SaveAs is overriden in the following manner duing OnConnection.

Set saveAsBtn = cbrMenu.FindControl(Id:=748)

When SaveAs is clicked we just display a Message Box
When the new menu item is clicked, instead of displaying the message
box, it displays the Save As dialog.
Why is our overriden SaveAs button functionality not being called?

Thanks,
AM
 
T

tfsjohan

Have you set the OnAction property on saveAsBtn?

Have you tried just creating a sub called FileSaveAs in a module?
Like,

Public Sub FileSaveAs()
' Your override
End Sub
 
Top