473,241 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 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 4901
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: WalterB | last post by:
I was wondering if you could help point me in the right direction? I have a database application that is originally installed using an MSI (it has a Crystal Report, needed to register license...
7
by: Job Lot | last post by:
How can I terminate console application in Try…Catch…Finally…End Try block so that code in Finally gets executed. If I use End statement Finally does not get executed. Following is my code...
1
by: Paul | last post by:
I am using a windows service which accesses Microsoft Outlook. Outlook is supposed to send an email. This works fine when not run in a windows service. I am running the service under my user...
3
by: Lauren Wilson | last post by:
Hi folks, We have an Access 2000 app that is highly integrated with Outlook 2000 or later. The app allows the user to send predefined emails that are created through an Access form and stored...
7
by: Matthew MacDonald | last post by:
Hi all, I'm trying to have an email message automatically generated when a button is clicked on an asp.net web form. I'm using portions of the sample code from...
0
by: rcoutts | last post by:
I have a custom Access database that is a bulk mailing program for my small business to send emails to my customers (not spam!). Before sending mail, I export a folder in Outlook to an Access MDB...
5
by: Arno R | last post by:
Hi all, I need to get at specific (shared) agenda-data from MS outlook 2003. I need every day to get the scheduled 'appointments' for some rooms to Access. In Access I will show the...
2
by: Randy Harris | last post by:
I have an A2K app that generates a mail message in Outlook. It properly fills in the To and CC lines in Outlook, but Outlook doesn't attempt to resolve the names until the user manually changes...
0
by: brossyg | last post by:
I have some VBA code that creates an email in Access and sends it from Outlook. It is based on a query with a list of email addresses. It sends the first email to Outlook and then I have to manually...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...

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.