Problem: VB.NET Outlook Addin - declare new application object
From: Jeanine (Jeanine_at_discussions.microsoft.com)
Date: 03/07/05
- Next message: Oliver Giesen: "Re: Outlook 2003 won't unload from memory with my COM add-in..."
- Previous message: Sukhvinder Lamba via OfficeKB.com: "Attaching files to mails using Outlook Object model."
- Next in thread: Helmut Obertanner: "Re: Problem: VB.NET Outlook Addin - declare new application object"
- Reply: Helmut Obertanner: "Re: Problem: VB.NET Outlook Addin - declare new application object"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 7 Mar 2005 04:11:03 -0800
I have a vb.net outlook addin with the following problem. I have to use the
NEW keyword when declaring my Outlook.Application object. I don't think I
should be using the new keyword, as in all the samples I have look at you
just set a reference to the application object parsed into the connect
procedure. If I don't use the New keyword then I get "object reference not
set" errors.
The reason I'm concerned about this is because when Outlook closes, it takes
quite a while to close fully when my addin is installed. I'm wondering if
having to declare the application as new is the cause of this.
Here is a sample of my code:
Public Sub OnConnection(ByVal application As Object, ByVal connectMode As
Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As
System.Array) Implements Extensibility.IDTExtensibility2.OnConnection
Dim oApp As Outlook.Application
...
oApp = CType(application, Outlook.Application)
...
m_BaseClass.InitHandler(oApp, MyProgID)
...
End Sub
Public Class OutAddin
Dim WithEvents objOutlook As New Outlook.Application
Friend Sub InitHandler(ByVal oApp As Outlook.Application, ByVal strPID As
String)
Try
objOutlook = oApp
...
Any suggestions would be appreciated.
Thanks
Jeanine
- Next message: Oliver Giesen: "Re: Outlook 2003 won't unload from memory with my COM add-in..."
- Previous message: Sukhvinder Lamba via OfficeKB.com: "Attaching files to mails using Outlook Object model."
- Next in thread: Helmut Obertanner: "Re: Problem: VB.NET Outlook Addin - declare new application object"
- Reply: Helmut Obertanner: "Re: Problem: VB.NET Outlook Addin - declare new application object"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|