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
 

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