PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Program Addins Add-in only runs once.

Reply

Add-in only runs once.

 
Thread Tools Rate Thread
Old 02-06-2007, 06:53 AM   #1
=?Utf-8?B?RGV3ZXk=?=
Guest
 
Posts: n/a
Default Add-in only runs once.


Hi.

I've created an add-in using the exact steps shown here using VB.net in
Visual Studio 2005:

http://support.microsoft.com/?kbid=302896

I've added a generic form in this project too. When I first run Outlook
and click on the toolbar button it inserted, it somehow knows to show the
form! (I never call .Show( ) for the form anywhere).
This is actually what I want, but it will only show once. Can someone
explain why the form is shown in the first place? Does VS just know to make
the first form the startup object for a COM add-in? Anyone know why it will
only work once?


Thanks for the help

-Josh

  Reply With Quote
Old 02-06-2007, 07:57 AM   #2
=?Utf-8?B?RGV3ZXk=?=
Guest
 
Posts: n/a
Default RE: Add-in only runs once.

okay....nevermind...duh. I just used the ToolbarButton_Click event to show a
new instance of the form.

Here's a follow-on though. Is there a way to address the button I have on
the toolbar from within the form's code?


Thanks


"Dewey" wrote:

> Hi.
>
> I've created an add-in using the exact steps shown here using VB.net in
> Visual Studio 2005:
>
> http://support.microsoft.com/?kbid=302896
>
> I've added a generic form in this project too. When I first run Outlook
> and click on the toolbar button it inserted, it somehow knows to show the
> form! (I never call .Show( ) for the form anywhere).
> This is actually what I want, but it will only show once. Can someone
> explain why the form is shown in the first place? Does VS just know to make
> the first form the startup object for a COM add-in? Anyone know why it will
> only work once?
>
>
> Thanks for the help
>
> -Josh
>

  Reply With Quote
Old 02-06-2007, 08:17 AM   #3
=?Utf-8?B?RGV3ZXk=?=
Guest
 
Posts: n/a
Default RE: Add-in only runs once.

Maybe I should have been more specific about that second question. What I
mean is...I have the code for the toolbar add-in (from the MSDN
article)...that's one class. Then, I have the form. When I click the button
on the toolbar, the form is displayed. I'd like to be able to grey-out the
button on the toolbar while the form is shown to the user. However, the
button is defined in the add-in class, not the form, and it's not accessible
from the form that I can tell. Is there something else basic I'm missing
here? I've tried calling it Public in the add-in, and even creating a module
to try to just be a programming slob and make it global. Neither worked.
There's got to be a simple technique I'm not remembering.

Thanks again

-Josh




"Dewey" wrote:

> okay....nevermind...duh. I just used the ToolbarButton_Click event to show a
> new instance of the form.
>
> Here's a follow-on though. Is there a way to address the button I have on
> the toolbar from within the form's code?
>
>
> Thanks
>
>
> "Dewey" wrote:
>
> > Hi.
> >
> > I've created an add-in using the exact steps shown here using VB.net in
> > Visual Studio 2005:
> >
> > http://support.microsoft.com/?kbid=302896
> >
> > I've added a generic form in this project too. When I first run Outlook
> > and click on the toolbar button it inserted, it somehow knows to show the
> > form! (I never call .Show( ) for the form anywhere).
> > This is actually what I want, but it will only show once. Can someone
> > explain why the form is shown in the first place? Does VS just know to make
> > the first form the startup object for a COM add-in? Anyone know why it will
> > only work once?
> >
> >
> > Thanks for the help
> >
> > -Josh
> >

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off