Access 2007 and Access 2003 Outlook email problem

hardrock

Registered User.
Local time
Today, 12:43
Joined
Apr 5, 2007
Messages
166
Hi Guys, i have Access 2007 and 2003 loaded on the same machine, although i do use Acc2007, i still prefer to write my apps using the 2003 version, as i'm old fashioned!

But i have a compatibility issue thats doing my head in - In principle both versions work ok, but the function

Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)

Does not create a new email instance in outlook when run. Only happens with both versions installed, yet outlook object libraries are clearly referenced. Is this a known problem and can it be fixed? I'm using outlook 2007.

Thanks
 
Last edited:
Are you using Both Outlook 2003/2007 or just 2007?

Could you check if you are getting an application object?

Have your tried this to say exactly which version you want?

Code:
createobject("outlook.application.12")

Also I assume that you have outlook referenced in Access so I am pretty sure that this will work as well

Code:
Dim appOutLook As Outlook.Application
Set appOutLook = = new Outlook.Application
 
If you are actively using Outlook for 2007, then (by definition) it is fully installed and your libraries are defined for 2007. Outlook 2003 almost certainly uses different libraries and the question is whether they are visible. Worse, the objects you are creating might need to be more fully qualified. I'm not completely sure how to do this when the qualifier is potentially the same name for both versions.

Here's a contrasting case in point. In ADO and in DAO recordsets, you have potential incompatibilites. You need to qualify a recordset as ADO.recordset or DAO.recordset in order to be sure you get the right data structures. If you try to use a DAO method on an ADO recordset, >>>bang zoom<<< you get a real mess on your hands.

So back to your question: If anything has changed structurally betwen Outlook 2003 and 2007, you have to be sure that you qualify the structures with the right version, but when both objects have the same name, it gets trickier. You have to watch and adjust the reference order.

Let's say that you have both Outlook 2003 and Outlook 2007 defined in your references. If you want to use the 2003 version, then you must make that version appear before (above) the other version so that when it searches, it hits the 2003 libraries first. On the "references" dialog box that lets you check your references, highlight a library and use the up/down arrows to make that library be searched first or last as needed.

Outside of these comments, I'm not sure how much more help I can offer as Outlook is not something I play with that often.
 
if its anything like A2007, then the two can't coexist peacefully

when you try to flip between A2003, and A2007 each one has to reinstall

I also dont think you can set reference for BOTH Outlook 11 and Outlook 12

I dont know for sure though, as on different computers I have

a) Office 2003 and A2007

b) Office 2007, and old versions of Access only.

so, i only have conflicting versions of Access - not of anything else
 

Users who are viewing this thread

Back
Top Bottom