How to support Outlook 2000, 2002, 2003

Add-in Express™ Support Service
That's what is more important than anything else

How to support Outlook 2000, 2002, 2003
 
Adam Toth Toth




Posts: 24
Joined: 2005-03-08
Hi

Im developing a very simple Addin for Outlook - need to get the current Mail Item and Save it to a Folder.

I'm guessing that I should AVOID using any PIA in my code and only use late binding such as:

AE = HostApplication.GetType().InvokeMember("ActiveExplorer",System.Reflection.BindingFlags.GetProperty, null, HostApplication, null);

Am I right, or is there a better way to go about this?

Any tips on how to get the current Mail Item using late binding?

Adam
Posted 08 Mar, 2005 11:14:10 Top
Eugene Starostin


ADX Team
Add-in Express team


Posts: 430
Joined: 2004-04-05
Hi Adam,

I'm guessing that I should AVOID using any PIA in my code and only use late binding such as


I cannot agree. PIAs make automation more easy than late binding.

Any tips on how to get the current Mail Item using late binding?


Have a look our toys. We use Outlook 2000 PIA we generated ourselves.
Posted 08 Mar, 2005 12:31:43 Top
Adam Toth




Posts: 24
Joined: 2005-03-08
Thanks for the response.

If I could get hold of OL2000 PIA and built against that, would the AddIn still work for 2002 and 2003?

I dont understand what would happen during deployment, presumably the OL 2000 assemblies would get installed, even if the user had OL2003?

Late binding is not too bad for what I need and gives me the advantage of not having to worry about what version of Outlook is installed, provided I dont use any features that have been introduced since 2000.

I am very new to COM Add Ins but Ive got mine working in a few hours thanks to you guys! 8)
Posted 08 Mar, 2005 12:44:01 Top
Eugene Starostin


ADX Team
Add-in Express team


Posts: 430
Joined: 2004-04-05
If I could get hold of OL2000 PIA and built against that, would the AddIn still work for 2002 and 2003?


Sure. What Outlook version do you have? Try our toys, it uses Outlook 2000 PIA.

I dont understand what would happen during deployment, presumably the OL 2000 assemblies would get installed, even if the user had OL2003?


Hmm... All PIAs are imported type libraries that do not depend on the applications. PIAs contain only wrappers over COM interfaces.
Posted 08 Mar, 2005 12:53:36 Top
Adam Toth




Posts: 24
Joined: 2005-03-08
I have OL 2003.

I couldnt get the toys to work as I cant compile them - I get error:

"Could not find type 'ADXOutlookAppEvents'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built."



Posted 08 Mar, 2005 13:44:35 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Adam.

It seems to me that you use an old version of ADX. Am I right? You need to update your ADX up to 2.2 Preview. You can do this in Premium area on our web site.
Posted 08 Mar, 2005 14:15:05 Top
Guest


Guest


Thanks Ive done that and it does now work.

Can I use the Interop.Outlook.dll from the toys example - presumably this is all I need to use the Outlook 2000 PIA?
Posted 08 Mar, 2005 14:39:31 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Yes, of course. You can use the Interop.Outlook.dll in your projects. This dll is already signed with strong name and can be placed into GAC.
Posted 08 Mar, 2005 15:03:26 Top
Oliver Degnan




Posts: 54
Joined: 2005-02-03
OK. Here is what I did and it works:

Go to Project Properties.
Add the name of the .snk file to the Wrapper Assembly Key File property under the Common tab.

Thanks Sergey for pointing this out.
Posted 10 Mar, 2005 13:22:31 Top