![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
#12
| |||
| |||
|
|
I tried this and had no error on the CreateObject line. *The only CDO reference I have is to cdosys.dll. *That said I do get an error on the objMessage.Send line as you have to configure the SMTP server details before you can send using CDO. *The following seems a good tutorial on the subject in a VB/VBA environment: http://www.developerfusion.com/artic...mail-dispatch/ HTH Jon "Lou O" <lgeastw... (AT) gmail (DOT) com> wrote in message news:3a330240-4ef6-432e-82b8-b2ac3fedaa97 (AT) d5g2000yqg (DOT) googlegroups.com... Douglas, I removed the "New" keyword but the error persists. Regarding the missing module referred in the error - do you know what that is? Is it a library or something else? 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 I must be overlooking or missing something else but I'm not sure what. Do you have any further ideas? Thanks On Nov 7, 6:15 pm, "Douglas J Steele" NOSPAM_djsteele (AT) NOSPAM_gmail (DOT) com> wrote: 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 |
#13
| |||
| |||
|
|
I tried this and had no error on the CreateObject line. The only CDO reference I have is to cdosys.dll. That said I do get an error on the objMessage.Send line as you have to configure the SMTP server details before you can send using CDO. The following seems a good tutorial on the subject in a VB/VBA environment: http://www.developerfusion.com/artic...mail-dispatch/ HTH Jon "Lou O" <lgeastw... (AT) gmail (DOT) com> wrote in message news:3a330240-4ef6-432e-82b8-b2ac3fedaa97 (AT) d5g2000yqg (DOT) googlegroups.com... Douglas, I removed the "New" keyword but the error persists. Regarding the missing module referred in the error - do you know what that is? Is it a library or something else? 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 I must be overlooking or missing something else but I'm not sure what. Do you have any further ideas? Thanks On Nov 7, 6:15 pm, "Douglas J Steele" NOSPAM_djsteele (AT) NOSPAM_gmail (DOT) com> wrote: 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 |
#14
| |||
| |||
|
|
I'm using your code Lou and for me there is no problem with the Set objMessage = CreateObject("CDO.Message") line. *Like I say the only problem with your code for me is that you haven't set the SMTP properties required so the following works perfectly for me. Dim objMessage As New CDO.Message Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "jo.s... (AT) whatever (DOT) com" objMessage.To = "jo.rece... (AT) any (DOT) com" objMessage.TextBody = "This is some sample message text." objMessage.AddAttachment "c:\temp\sample.txt" objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Name or IP of remote SMTP server objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "dellserver" 'Server port objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objMessage.Configuration.Fields.Update objMessage.Send Try it in a new database with standard references plus a reference to: Microsoft CDO for Windows 2000 Library. *The location of this on my PC is C:\Windows\System32\cdosys.dll. *Does this reference appear in the available references list? *If not (because as others have pointed out the CDO library is not necessarily installed as standard) you may need to register cdosys.dll by running regsvr32 from a command prompt (google to find out how). Does this help? Jon Hi Jon |
|
"Lou O" <lgeastw... (AT) gmail (DOT) com> wrote in message news:15ff9e40-a78f-47f3-9678-8e534dcb889a (AT) y7g2000vbe (DOT) googlegroups.com... On Nov 9, 9:36 am, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com wrote: I tried this and had no error on the CreateObject line. The only CDO reference I have is to cdosys.dll. That said I do get an error on the objMessage.Send line as you have to configure the SMTP server details before you can send using CDO. The following seems a good tutorial on the subject in a VB/VBA environment: http://www.developerfusion.com/artic...mail-dispatch/ HTH Jon "Lou O" <lgeastw... (AT) gmail (DOT) com> wrote in message news:3a330240-4ef6-432e-82b8-b2ac3fedaa97 (AT) d5g2000yqg (DOT) googlegroups.com... Douglas, I removed the "New" keyword but the error persists. Regarding the missing module referred in the error - do you know what that is? Is it a library or something else? 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 I must be overlooking or missing something else but I'm not sure what. Do you have any further ideas? Thanks On Nov 7, 6:15 pm, "Douglas J Steele" NOSPAM_djsteele (AT) NOSPAM_gmail (DOT) com> wrote: 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 Thanks Jon I followed the link and followed the tutorial. But alas the same error pops up. I know it's something stupid and obvious but it continues to elude me! Would you mind posting your code behind this procedure to see if can spot the obvious? Lou |
#15
| |||
| |||
|
|
I'm using your code Lou and for me there is no problem with the Set objMessage = CreateObject("CDO.Message") line. Like I say the only problem with your code for me is that you haven't set the SMTP properties required so the following works perfectly for me. Dim objMessage As New CDO.Message Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "jo.s... (AT) whatever (DOT) com" objMessage.To = "jo.rece... (AT) any (DOT) com" objMessage.TextBody = "This is some sample message text." objMessage.AddAttachment "c:\temp\sample.txt" objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Name or IP of remote SMTP server objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "dellserver" 'Server port objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objMessage.Configuration.Fields.Update objMessage.Send Try it in a new database with standard references plus a reference to: Microsoft CDO for Windows 2000 Library. The location of this on my PC is C:\Windows\System32\cdosys.dll. Does this reference appear in the available references list? If not (because as others have pointed out the CDO library is not necessarily installed as standard) you may need to register cdosys.dll by running regsvr32 from a command prompt (google to find out how). Does this help? Jon Hi Jon |
|
"Lou O" <lgeastw... (AT) gmail (DOT) com> wrote in message news:15ff9e40-a78f-47f3-9678-8e534dcb889a (AT) y7g2000vbe (DOT) googlegroups.com... On Nov 9, 9:36 am, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com wrote: I tried this and had no error on the CreateObject line. The only CDO reference I have is to cdosys.dll. That said I do get an error on the objMessage.Send line as you have to configure the SMTP server details before you can send using CDO. The following seems a good tutorial on the subject in a VB/VBA environment: http://www.developerfusion.com/artic...mail-dispatch/ HTH Jon "Lou O" <lgeastw... (AT) gmail (DOT) com> wrote in message news:3a330240-4ef6-432e-82b8-b2ac3fedaa97 (AT) d5g2000yqg (DOT) googlegroups.com... Douglas, I removed the "New" keyword but the error persists. Regarding the missing module referred in the error - do you know what that is? Is it a library or something else? 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 I must be overlooking or missing something else but I'm not sure what. Do you have any further ideas? Thanks On Nov 7, 6:15 pm, "Douglas J Steele" NOSPAM_djsteele (AT) NOSPAM_gmail (DOT) com> wrote: 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 Thanks Jon I followed the link and followed the tutorial. But alas the same error pops up. I know it's something stupid and obvious but it continues to elude me! Would you mind posting your code behind this procedure to see if can spot the obvious? Lou |
![]() |
| Thread Tools | |
| Display Modes | |
| |