![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
In this news group I came across the CDO Library method with very simple code as below |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
I have been looking for a way to send an email from access with an independent file attachment. In other words without using the sendobject method which sends only access objects. In this news group I came across the CDO Library method with very simple code as below Dim objMessage As New CDO.Message Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "me (AT) my (DOT) com" objMessage.To = "loosterhoff (AT) gmail (DOT) com" objMessage.TextBody = "This is some sample message text." objMessage.AddAttachment "c:\temp\readme.txt" objMessage.Send However the code generates the following error running the Set......CreateObject line Run-time error '-2147024770(8007007e)': Automation Error The specified module could not be found. Does anyone know what this error means? Am I missing a class module that this method requires? I have a suspicion that it refers to MS Outlook (not installed) but I'm not sure. Thanks for your help Lou O |
#5
| |||
| |||
|
|
Not sure whether it's related to your error, but you do not use the New keyword in conjunction with Set. Try: Dim objMessage As CDO.Message * Set objMessage = CreateObject("CDO.Message") "Lou O" *wrote in message news:f3919cc9-5317-4703-b6cd-a6af6def7666 (AT) w20g2000prc (DOT) googlegroups.com... I have been looking for a way to send an email from access with an independent file attachment. In other words without using the sendobject method which sends only access objects. In this news group I came across the CDO Library method with very simple code as below Dim objMessage As New CDO.Message Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "m... (AT) my (DOT) com" objMessage.To = "loosterh... (AT) gmail (DOT) com" objMessage.TextBody = "This is some sample message text." objMessage.AddAttachment "c:\temp\readme.txt" objMessage.Send However the code generates the following error running the Set......CreateObject line Run-time error '-2147024770(8007007e)': Automation Error The specified module could not be found. Does anyone know what this error means? Am I missing a class module that this method requires? I have a suspicion that it refers to MS Outlook (not installed) but I'm not sure. Thanks for your help Lou O |
#6
| |||
| |||
|
|
On Mon, 7 Nov 2011 10:02:49 -0800 (PST), Lou O <lgeastw... (AT) gmail (DOT) com wrote: In this news group I came across the CDO Library method with very simple code as below Microsoft Access Email FAQ - CDONTShttp://www.granite.ab.ca/access/email/cdonts.htm Beginning in Exchange Server 2007 and Outlook 2007, CDO 1.2.1 will no longer be provided as a part of the install of the product. Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages -http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files * updated seehttp://www.autofeupdater.com/ |
#7
| |||
| |||
|
|
On Mon, 7 Nov 2011 10:02:49 -0800 (PST), Lou O <lgeastw... (AT) gmail (DOT) com wrote: In this news group I came across the CDO Library method with very simple code as below Microsoft Access Email FAQ - CDONTShttp://www.granite.ab.ca/access/email/cdonts.htm Beginning in Exchange Server 2007 and Outlook 2007, CDO 1.2.1 will no longer be provided as a part of the install of the product. Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages -http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files * updated seehttp://www.autofeupdater.com/ |
#8
| |||
| |||
|
|
Tony are you saying I need to have the above mentioned products installed in order to run the CDO code successfully? |
|
I have downloaded and installed MS Collaboration Data Objects 1.2.1 as well as Microsoft Exchange Server MAPI Client, both CDO.dll & CDOsys.dll appear in my System32 folder. I have checked off CDO Library 1.21 and CDO for Windows 2000 Library in the references. The code compiles without errors - but the error still pops up on the Set .....CreateObject What am I still missing? |
#9
| |||
| |||
|
|
Not sure whether it's related to your error, but you do not use the New keyword in conjunction with Set. Try: Dim objMessage As CDO.Message Set objMessage = CreateObject("CDO.Message") "Lou O" wrote in message news:f3919cc9-5317-4703-b6cd-a6af6def7666 (AT) w20g2000prc (DOT) googlegroups.com... I have been looking for a way to send an email from access with an independent file attachment. In other words without using the sendobject method which sends only access objects. In this news group I came across the CDO Library method with very simple code as below Dim objMessage As New CDO.Message Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "m... (AT) my (DOT) com" objMessage.To = "loosterh... (AT) gmail (DOT) com" objMessage.TextBody = "This is some sample message text." objMessage.AddAttachment "c:\temp\readme.txt" However the code generates the following error running the Set......CreateObject line Run-time error '-2147024770(8007007e)': Automation Error The specified module could not be found. Does anyone know what this error means? Am I missing a class module that this method requires? I have a suspicion that it refers to MS Outlook (not installed) but I'm not sure. Thanks for your help Lou O |
#10
| |||
| |||
|
|
On Tue, 8 Nov 2011 08:13:31 -0800 (PST), Lou O lgoosterh... (AT) gmail (DOT) com> wrote: Tony are you saying I need to have the above mentioned products installed in order to run the CDO code successfully? No, just that you can't count on CDO being installed. I have downloaded and installed MS Collaboration Data Objects 1.2.1 as well as Microsoft Exchange Server MAPI Client, both CDO.dll & CDOsys.dll appear in my System32 folder. I have checked off CDO Library 1.21 and CDO for Windows 2000 Library in the references. The code compiles without errors - but the error still pops up on the Set .....CreateObject What am I still missing? No idea. Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages -http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files * updated seehttp://www.autofeupdater.com/ |
![]() |
| Thread Tools | |
| Display Modes | |
| |