By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,563 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,563 IT Pros & Developers. It's quick & easy.

References to different versions of MS Outlook in a VB.NET application

P: n/a
I am writing an application that utilizes a reference to Microsoft
Outlook. (Added a reference to the MS Outlook COM interface to my
project). I then write code such as:

dim olApp as new Outlook.Applicaiton
dim olNamespace as OutlOok.Namespace = olApp.....

I am deploying my application via the "publish" feature that makes it
downloadable and installable via the web.

The problem I'm running into is that I need the application to work with
various versions of Outlook (2003 & 2007, currently), or to not
utilize outlook at all. I can write error handling codes inside the
program to check for what version they have installed, but am running
into two problems.

1. Compiling: I am developing the application on a computer with OL 2007
(v.12), and can therefore not add a reference for the OL 2003 (v.11) COM
reference. I tried copying the project to another computer with OL 2003
and adding the reference there, but then it complains about not having
OL 2007. I've thought about just using late binding ("dim olApp as
object = createobject("Outlook.Application")") but really don't want to
go that route if I can avoid it.

2. Deploying: If I do compile the program using OL 2007 references and
they try to deploy / install to a computer without Outlook or with
Outlook 2003, it will not install because it needs the office 12.0
libraries installed in the GAC beforehand.

Is there a workaround for these two issues to make my application not
quite so dependent upon the references to specific versions of outlook,
yet still be able to do early binding throughout my code?
Nov 26 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Nov 26, 8:30 am, Chet wrote:
I am writing an application that utilizes a reference to Microsoft
Outlook. (Added a reference to the MS Outlook COM interface to my
project). I then write code such as:

dim olApp as new Outlook.Applicaiton
dim olNamespace as OutlOok.Namespace = olApp.....

I am deploying my application via the "publish" feature that makes it
downloadable and installable via the web.

The problem I'm running into is that I need the application to work with
various versions of Outlook (2003 & 2007, currently), or to not
utilize outlook at all. I can write error handling codes inside the
program to check for what version they have installed, but am running
into two problems.

1. Compiling: I am developing the application on a computer with OL 2007
(v.12), and can therefore not add a reference for the OL 2003 (v.11) COM
reference. I tried copying the project to another computer with OL 2003
and adding the reference there, but then it complains about not having
OL 2007. I've thought about just using late binding ("dim olApp as
object = createobject("Outlook.Application")") but really don't want to
go that route if I can avoid it.

2. Deploying: If I do compile the program using OL 2007 references and
they try to deploy / install to a computer without Outlook or with
Outlook 2003, it will not install because it needs the office 12.0
libraries installed in the GAC beforehand.

Is there a workaround for these two issues to make my application not
quite so dependent upon the references to specific versions of outlook,
yet still be able to do early binding throughout my code?
A company I worked for had the exact same problem. The way they
solved it for years was to compile the program on a machine with the
older outlook on it since they are backwards compatible.

They ended up solving it by writing a web service that would do all
the e-mailing this way they didn't have to recompile for anything and
the only computer that needed the outlook reference was the one with
the web service.
Nov 26 '07 #2

P: n/a

I think I've tried this (compiled on the computer with older version)
and that would probably work, kind of. However, I want the program to
also run if the user doesn't have Outlook installed *at all* (it's kind
of an optional "feature") and so far haven't gotten anywhere with this.

Nov 26 '07 #3

P: n/a
Chet wrote:
>
I think I've tried this (compiled on the computer with older version)
and that would probably work, kind of. However, I want the program to
also run if the user doesn't have Outlook installed *at all* (it's kind
of an optional "feature") and so far haven't gotten anywhere with this.
I think I got this to work, or at least am making some progress. I went
to my references and changed it to "copy local" intead of "required" for
the outlook; it then installs fine. ... and the weird thing is, I am
using the OL 2007 reference on my develop / build computer and OL 2003
on my test computer, and it works just fine!
Nov 26 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.