471,580 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,580 software developers and data experts.

Problem automating outlook

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

Mar 26 '06 #1
7 4811
Try using SET to create an instance of the object:

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

Later,
David

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:oK********************@pipex.net...
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

Mar 26 '06 #2
I am now using;

Set O = CreateObject("Outlook.Application")

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

Regards

"David Harlowe" <da***********@nomail.com> wrote in message
news:u4******************@newssvr25.news.prodigy.n et...
Try using SET to create an instance of the object:

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

Later,
David

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:oK********************@pipex.net...
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


Mar 26 '06 #3
John wrote:
I am now using;

Set O = CreateObject("Outlook.Application")

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

Regards

"David Harlowe" <da***********@nomail.com> wrote in message
news:u4******************@newssvr25.news.prodigy.n et...
Try using SET to create an instance of the object:

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

Later,
David

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:oK********************@pipex.net...
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


It's been some time since I've played with Outlook OLE, but I think
CreateObject requires early binding, in which case you would need a
reference to the Outlook library and O dimmed as an Outlook object. If
you want to use late binding (without the Outlook library and O dimmed
as just Object), you would use GetObject.

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
Mar 26 '06 #4
This example from Microsoft may be helpful:

http://support.microsoft.com/kb/161088

Later,
David

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:Bo******************************@pipex.net...
I am now using;

Set O = CreateObject("Outlook.Application")

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

Regards

"David Harlowe" <da***********@nomail.com> wrote in message
news:u4******************@newssvr25.news.prodigy.n et...
Try using SET to create an instance of the object:

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

Later,
David

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:oK********************@pipex.net...
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

Mar 27 '06 #5
Apparently using

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

fixes the problem. Not sure why though.

Regards

"David Harlowe" <da***********@nomail.com> wrote in message
news:1w****************@newssvr11.news.prodigy.com ...
This example from Microsoft may be helpful:

http://support.microsoft.com/kb/161088

Later,
David

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:Bo******************************@pipex.net...
I am now using;

Set O = CreateObject("Outlook.Application")

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

Regards

"David Harlowe" <da***********@nomail.com> wrote in message
news:u4******************@newssvr25.news.prodigy.n et...
> Try using SET to create an instance of the object:
>
> Dim O As Object
> Set O = CreateObject("Outlook.Application")
>
> Later,
> David
>
> "John" <Jo**@nospam.infovis.co.uk> wrote in message
> news:oK********************@pipex.net...
>> 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


Mar 27 '06 #6
Ted
Here is what I use, and of course you need to have a Reference to
Outlook.

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
Set objOutlookRecip = .Recipients.Add(CRS1.Fields("Email"))
Set objOutlookAttach = .Attachments.Add(strInputFileName)

Mar 27 '06 #7
Set objOutlook = CreateObject("Outlook.Application","localhost") worked for
me. Nothing else.

Regards

"Ted" <be*****@gmail.com> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
Here is what I use, and of course you need to have a Reference to
Outlook.

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
Set objOutlookRecip = .Recipients.Add(CRS1.Fields("Email"))
Set objOutlookAttach = .Attachments.Add(strInputFileName)

Mar 27 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by WalterB | last post: by
7 posts views Thread by Job Lot | last post: by
7 posts views Thread by Matthew MacDonald | last post: by
5 posts views Thread by Arno R | last post: by
2 posts views Thread by Randy Harris | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
1 post views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.