Re: click addin button by program
From: Shinya (shinya_at___donotsendme.com)
Date: 10/18/04
- Next message: Shinya: "how to find addin button ID?"
- Previous message: Eugene E. Starostin: "ANN: Add-in Express .NET - Start Your Add-ins, Smart Tags and RTDS Faster"
- In reply to: Ken Slovak - [MVP - Outlook]: "Re: click addin button by program"
- Next in thread: Ken Slovak - [MVP - Outlook]: "Re: click addin button by program"
- Reply: Ken Slovak - [MVP - Outlook]: "Re: click addin button by program"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 17 Oct 2004 19:49:03 -0700
Ken,
I found a problem.
g_button.Execute only works in
OnStartupComplete. I added one
function in the same module and
didn't do anything not even displaying
message.
Shinya
"Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> wrote in message
news:Oa6hdUssEHA.1308@tk2msftngp13.phx.gbl...
> It works here but I just noticed that you mentioned earlier in the thread
> that you are talking about Word and not Outlook. It might be somewhat
> different in Word than in Outlook.
>
> Here's what I did in Outlook. I created a new button in On_Connect by
adding
> it to the Application.ActiveExplorer's Standard toolbar. Then I set the
> global button to the local button, then in Startup_Complete I called the
> global button's Execute method and the message box from the local button's
> Click event handler was displayed.
>
> ' In code module:
> Public g_button As Office.CommandBarButton
>
> ' In Designer:
> Private WithEvents m_button As Office.CommandBarButton
>
> ' In On_Connection:
> Dim oCB As Office.CommandBar
> Set oCB = Application.ActiveExplorer.CommandBars("Standard")
> Set m_button = oCB.Controls.Add(msoControlButton, , , True)
> m_button.OnAction = "!<" & AddInInst.ProgId & ">"
> m_button.Tag = "UniqueTag"
> m_button.Caption = "Test Button"
> m_button.Style = msoButtonCaption
> Set g_button = m_button
>
> ' In OnStartupComplete
> g_button.Execute
>
> ' The Click event handler for the button has this:
> MsgBox "Test"
>
> The g_button.Execute line of code could be anywhere in the COM addin since
> the global button has visibility throughout the addin.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> wrote in message
> news:%235pwb%23rsEHA.3572@tk2msftngp13.phx.gbl...
> > I'll play with it and post back here.
> >
> > --
> > Ken Slovak
> > [MVP - Outlook]
> > http://www.slovaktech.com
> > Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> > Reminder Manager, Extended Reminders, Attachment Options
> > http://www.slovaktech.com/products.htm
> >
> >
> > "Shinya" <shinya@__donotsendme.com> wrote in message
> > news:OaX5TDVsEHA.636@TK2MSFTNGP09.phx.gbl...
> > > however,
> > >
> > > g_mybutton.enable = false
> > >
> > > works fine. only I can't generate event
> > >
> > > Shinya
> >
> >
>
>
- Next message: Shinya: "how to find addin button ID?"
- Previous message: Eugene E. Starostin: "ANN: Add-in Express .NET - Start Your Add-ins, Smart Tags and RTDS Faster"
- In reply to: Ken Slovak - [MVP - Outlook]: "Re: click addin button by program"
- Next in thread: Ken Slovak - [MVP - Outlook]: "Re: click addin button by program"
- Reply: Ken Slovak - [MVP - Outlook]: "Re: click addin button by program"
- Messages sorted by: [ date ] [ thread ]