Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDO Browse To Attachment 1

Status
Not open for further replies.

naturalsn

Technical User
Apr 26, 2007
68
GB
Hi

I just recently changed sending emails from Access - Outlook to using CDO and working perfectly no problems except my attachemnt.

I used to via Outlook send emails to individual users as we are working with their record, and migth add an attachment or might not. I did add a Browse function to allow the user to browse to the location Add the File and Send.

Now however sending the email via CDO i do not seem to get to grips in allowing the browse for file functionality.
And was hoping someone could perhaps assist.

I am currently using the following

Code:
Private Sub SendEmail_Click()

Dim cdoConfig
Dim msgOne

Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServerPort) = (25)
.Item(cdoSMTPServer) = "mail.mymail.com"
.Item(cdoSendUserName) = "me@mymail.com"
.Item(cdoSendPassword) = "mepassword"
.Update
End With
Set msgOne = CreateObject("CDO.Message")
Set msgOne.Configuration = cdoConfig
msgOne.Subject = Me.Mess_Subject
msgOne.From = "myemail.com"
msgOne.To = Me.Email_Address
msgOne.HTMLBody = Me.mess_text
msgOne.BCC = Me.BCC_Address
msgOne.CC = Me.CC_Address

msgOne.AddAttachment = Me.Mail_Attachment_Path 

msgOne.Send

With the current attahcment code as above listed, after added the data to my text field i just get an error
Runtime 438
Object does not support this property.

would it still be possible to make use of my browsing facility.

Any help would be greatly appreciated.

 
replace this:
msgOne.AddAttachment = Me.Mail_Attachment_Path
with this:
msgOne.AddAttachment Me.Mail_Attachment_Path

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you so much. Something so small Pfff

Really appreciate the help.

SN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top