kvreddy

I wrote an event for Save As menu , it works fine for Office 2003, but its not working for Office 2007 (1 line of code below)

If evtFileSaveAs Is Nothing Then Set evtFileSaveAs = 'Application.CommandBars("Menu Bar").FindControl(, 748, , True, True)

I am expecting doubt like Save As Menu Id is not 748.

Is there any solution for this

Thanks in advance and help appriciated.





Re: Visual Studio Tools for Office Save As event not firing in Office 2007

Cindy Meister

The reason you're seeing this is that the new Ribbon interface is independent of the old CommandBars. A CommandBarButton Click event will only work with a CommandBar that is located in the "Add-ins" tab (where all commandbars are placed) or in the right-click context menu (which is still a CommandBar).

For anything else, you need to either trap the event (in this case DocumentBeforeSave) or repurpose the RibbonX for the document, template or application. You'll find more about using RibbonX here. A good discussion forum is at pschmid.net






Re: Visual Studio Tools for Office Save As event not firing in Office 2007


Re: Visual Studio Tools for Office Save As event not firing in Office 2007

Cindy Meister

And here is my answer

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1695536&SiteID=1

It's still valid. The discussion you link to is irrelevant, since Word 2007 does not use CommandBar controls anymore. If the user chooses a Ribbon command, you can trap all the CommandBarButton events you want. The Ribbon will never execute a CommandBarButton Click event.