Don't use OnAction but a variable declared withEvents and set to the
CommandBarButton object. See this example:
http://www.vboffice.net/sample.html?...6&cmd=showitem
--
Best regards
Michael Bauer - MVP Outlook
Manage and share your categories:
<http://www.vboffice.net/product.html?lang=en>
Am Sat, 6 Mar 2010 23:42:01 -0800 schrieb Sqt Waddle:
> Hello and TIA for your assistance,
>
> I am trying to convert VBA code in OL07 to an Add-in in VB6.
>
> The Add-in creates a custom command bar with three buttons and fires code
> when a new inspector is created.
>
> When I load the add-in the command bar appears, the new inspector code
fires
> and the add-in disconnects on exit.
>
> However, I cannot get the onaction event for the command bar buttons to
fire.
>
> The code that creates the button is:
> Set custBar = Application.ActiveExplorer.CommandBars.Add(Name:="Show",
> Position:=msoBarTop, Temporary:=True)
> custBar.Visible = True
>
>
> Set Cusbutton = custBar.Controls.Add(Type:=msoControlButton)
> With Application.ActiveExplorer.CommandBars("Show").Controls(1)
> .Style = msoButtonCaption
> .Caption = "My Stuff"
> .OnAction = "RunMyStuff"
> .ToolTipText = "My Stuff"
> .BeginGroup = True
> .Tag = "Test Tag"
> End With
>
> Where should I place Sun RunMyStuff so that it will fire when the button
is
> clicked?
>
> Thanks,