PC Review


Reply
Thread Tools Rate Thread

Showing a form in an .Net Outlook Add-In

 
 
Craig Buchanan
Guest
Posts: n/a
 
      20th Oct 2008
I've created an Add-In for Outlook (2003) using VB.Net (VS 2005). I'm
having difficulty w/ getting either of the forms that I created to be
visible.

I've defined the forms as class-level variable in the Connect class. This
is the code that is executed in the method that handles the button.click
(button is a CommandButtonBar) event:

form_Export = New Form_Export
form_Export.Show()

What am I missing?

Thanks,

Craig Buchanan


 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      20th Oct 2008
What exactly is happening? Is the form being started at all, does its
constructor get called? Is it a matter of the form not being on top or in
the front of the z-order? If it's a z-order issue have you tried setting the
form's .TopMost, TopLevel properties and/or the BringToFront() method?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Craig Buchanan" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I've created an Add-In for Outlook (2003) using VB.Net (VS 2005). I'm
> having difficulty w/ getting either of the forms that I created to be
> visible.
>
> I've defined the forms as class-level variable in the Connect class. This
> is the code that is executed in the method that handles the button.click
> (button is a CommandButtonBar) event:
>
> form_Export = New Form_Export
> form_Export.Show()
>
> What am I missing?
>
> Thanks,
>
> Craig Buchanan
>


 
Reply With Quote
 
Alan Moseley
Guest
Posts: n/a
 
      21st Oct 2008
Are you entirely sure that your add-in is loading? Has it been disabled
maybe. Have a look in Outlook, Help, About, Disabled Items.

Try putting a MsgBox in the Connect class to make sure that you are
connecting correctly.
--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"Craig Buchanan" wrote:

> I've created an Add-In for Outlook (2003) using VB.Net (VS 2005). I'm
> having difficulty w/ getting either of the forms that I created to be
> visible.
>
> I've defined the forms as class-level variable in the Connect class. This
> is the code that is executed in the method that handles the button.click
> (button is a CommandButtonBar) event:
>
> form_Export = New Form_Export
> form_Export.Show()
>
> What am I missing?
>
> Thanks,
>
> Craig Buchanan
>
>
>

 
Reply With Quote
 
Craig Buchanan
Guest
Posts: n/a
 
      22nd Oct 2008
There was an exception in the form's constructor that being thrown but not
caught by Outlook, so the code hung. I've corrected the code and the form
works as expected.

Incidentally, is there a type of exception that I can be caught by Outlook?
Probably a COM-type exception, I'll wager.

Thanks for your time, Ken.

"Ken Slovak - [MVP - Outlook]" wrote:

> What exactly is happening? Is the form being started at all, does its
> constructor get called? Is it a matter of the form not being on top or in
> the front of the z-order? If it's a z-order issue have you tried setting the
> form's .TopMost, TopLevel properties and/or the BringToFront() method?
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "Craig Buchanan" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > I've created an Add-In for Outlook (2003) using VB.Net (VS 2005). I'm
> > having difficulty w/ getting either of the forms that I created to be
> > visible.
> >
> > I've defined the forms as class-level variable in the Connect class. This
> > is the code that is executed in the method that handles the button.click
> > (button is a CommandButtonBar) event:
> >
> > form_Export = New Form_Export
> > form_Export.Show()
> >
> > What am I missing?
> >
> > Thanks,
> >
> > Craig Buchanan
> >

>
>

 
Reply With Quote
 
Craig Buchanan
Guest
Posts: n/a
 
      22nd Oct 2008
Alan-

There was an unhandled exception in the form's constructor that resulted in
the odd behavior.

Thanks for your reply.

"Alan Moseley" wrote:

> Are you entirely sure that your add-in is loading? Has it been disabled
> maybe. Have a look in Outlook, Help, About, Disabled Items.
>
> Try putting a MsgBox in the Connect class to make sure that you are
> connecting correctly.
> --
> Alan Moseley IT Consultancy
> http://www.amitc.co.uk
>
> If I have solved your problem, please click Yes below. Thanks.
>
>
> "Craig Buchanan" wrote:
>
> > I've created an Add-In for Outlook (2003) using VB.Net (VS 2005). I'm
> > having difficulty w/ getting either of the forms that I created to be
> > visible.
> >
> > I've defined the forms as class-level variable in the Connect class. This
> > is the code that is executed in the method that handles the button.click
> > (button is a CommandButtonBar) event:
> >
> > form_Export = New Form_Export
> > form_Export.Show()
> >
> > What am I missing?
> >
> > Thanks,
> >
> > Craig Buchanan
> >
> >
> >

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      22nd Oct 2008
When you use a try...catch block in your managed code you'll be catching
both .NET errors as well as COM exceptions.

Depending on what your code is doing you might also cause unhandleable
exceptions that won't come to your error handling and in some cases might
only fire after your addin is disconnected or Outlook is closed. I've seen
that with some errors that were seen with WordMail where after exit you see
a kernel32 error.

Outlook itself isn't going to catch any errors for you, but it will fire
errors up through the CLR and those would be COM exceptions since Outlook is
unmanaged code.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Craig Buchanan" <(E-Mail Removed)> wrote in message
news:A03075A4-2809-48A5-8018-(E-Mail Removed)...
> There was an exception in the form's constructor that being thrown but not
> caught by Outlook, so the code hung. I've corrected the code and the form
> works as expected.
>
> Incidentally, is there a type of exception that I can be caught by
> Outlook?
> Probably a COM-type exception, I'll wager.
>
> Thanks for your time, Ken.


 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing a form in an .Net Outlook Add-In Craig Buchanan Microsoft Outlook Interoperability 5 22nd Oct 2008 07:31 PM
Outlook Calendar entry form not showing Arcat36 Microsoft Outlook Calendar 1 11th Feb 2008 10:56 PM
Outlook 2003 - form not showing fields =?Utf-8?B?WW5leg==?= Microsoft Outlook Form Programming 12 27th Jul 2007 12:49 PM
Drop down boxes in word template form not showing up in outlook =?Utf-8?B?Q2hyaXM=?= Microsoft Outlook Discussion 1 23rd Jun 2006 07:22 PM
Showing a form in Outlook COM addin Jeff Bunting Microsoft Outlook Program Addins 0 22nd Jan 2004 05:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:06 PM.