Hi Patrick,
thank you very much for replying!
This is working for me so far. I can show a MsgBox from Sub myCallback. But how can I call an Outlook-macro from there or open a form which is part of my VbaProject.OTM file (VBA)? I assume it would be a better strategy to migrate them to an Add-In (especially for use with Office 2007!) but I'm afraid I have to write all the code and forms new and I'm not very experienced with VS 2005 so far.
If you could tell me how the macro could be called from the callback Sub I would appreciated that very much.
Kind regards,
Steffen Grellmann
On Wed, 21 Mar 2007 11:29:19 +0000, "Patrick Schmid [MVP]" <pdschmid[ at ]nospam.mvps.org> wrote:
[Quoted Text] >You have to specift the onAction attribute in the RibbonX and implement >the appropriate callback in your VB file. You should consult > http://msdn2.microsoft.com/en-us/library/aa722523.aspx for the correct >VB syntax of the callback. >Basically you'd have something like this in your RibbonX: ><button id="MyButton" onAction="myCallback" /> > >And in VB: >Sub myCallback(control as IRibbonControl) > >End Sub > >Keep in mind that if you are targeting more than one inspector in >Outlook, you'll have to evaluate the context attribute of the >IRibbonControl to figure out which Inspector triggered the callback. > >Patrick Schmid [OneNote MVP] >-------------- > http://pschmid.net>*** >Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80>*** >Customize Office 2007: http://pschmid.net/office2007/customize>RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer>OneNote 2007: http://pschmid.net/office2007/onenote>*** >Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed> > >"Steffen Grellmann" <anonymous[ at ]anonym.de> wrote in message >news:lk0203t7vk1je2uul0a0d5b16dqoobf6ld[ at ]4ax.com: > >> Hi Newsgroup, >> >> I'm able to add user-defined groups and buttons to the Ribbon using >> VSTO SE. Just a beginners question: What would be the best practice to >> call a Outlook-Macro if a userdefined button in the ribbon is clicked? >> Do I have to use "OnAction" in the xml file or do I have do use the >> callback in my Ribbon.vb file? A code snipped would be very welcome. >> >> Your time and help is highly appreciated. >> >> Kind regards, >> >> Steffen
|