View Single Post
  #6  
Old March 27th 06, 03:51 PM posted to microsoft.public.outlook,microsoft.public.outlook.general,microsoft.public.outlook.interop,microsoft.public.outlook.program_vba
John
external usenet poster
 
Posts: 135
Default Problem automating outlook

Apparently using

Set objOutlook = CreateObject("Outlook.Application","localhost")

fixes the problem. Not sure why though.

Regards


"Mark Dormer" wrote in message
...
I wasn't getting an error using the
Set O = CreateObject("Outlook.Application")


Perhaps it is something else in your code?
If you want paste it all.


FWIW I use this method.
In the VB Editor goto Tools - References and Add Microsoft Outlook 11.0
Library

Sub test()
Set ol = New Outlook.Application
Set olns = ol.GetNamespace("MAPI")
Set objFolder = olns.GetDefaultFolder(olFolderContacts)
End Sub



Regards
Mark Dormer



"John" wrote in message
...
I am now using;

Set O = CreateObject("Outlook.Application")

and I am getting the attached error. Outlook 2003 seems to be working
fine
otherwise. I have also done a detect and repair on it as well.

Regards


"Mark Dormer" wrote in message
...
Dim O As Object
Set O = CreateObject("Outlook.Application")


Regards
Mark Dormer





"John" wrote in message
...
Hi

I am using the following code to automate outlook from within MS
Access;

Dim O As Object
O = CreateObject("Outlook.Application")

The problem is that I am getting the following error on the second
line;

Automation error
The specified module can not be found

What is the problem and how can I fix it?

Thanks

Regards










Ads