![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hello, everyone,
I'm trying to send e-mails to my clients with an attachment. I'm using Office 2003. I've been able to send emails using a recordset, typing in the Subject, CC and Remarks in a form. It works very well. However, I cannot make the Attachment.Add work!! I'm quite frustrated! Please help! I am typing in the path in the form: ............ Set AttachmentPath = Forms!MAIL[Attachment] ..... 'Add the attachment to the e-mail message. If Not IsMissing(AttachmentPath) Then Set objOutlookAttach = .Attachments.Add(AttachmentPath) End If |
Ads |
#2
|
|||
|
|||
![]()
Wouldn't it be:
AttachmentPath = Forms!MAIL[Attachment] to set a string rather than an object? -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Myriam" wrote in message ... Hello, everyone, I'm trying to send e-mails to my clients with an attachment. I'm using Office 2003. I've been able to send emails using a recordset, typing in the Subject, CC and Remarks in a form. It works very well. However, I cannot make the Attachment.Add work!! I'm quite frustrated! Please help! I am typing in the path in the form: ........... Set AttachmentPath = Forms!MAIL[Attachment] .... 'Add the attachment to the e-mail message. If Not IsMissing(AttachmentPath) Then Set objOutlookAttach = .Attachments.Add(AttachmentPath) End If |
#3
|
|||
|
|||
![]()
Try running the code with a known file rather than relying on the value of a
field in your Access form. Also include the optional parameters just in case: ..Attachments.Add "C:\Test.doc", olByValue, 1, "Test" -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Myriam" wrote: Hello, everyone, I'm trying to send e-mails to my clients with an attachment. I'm using Office 2003. I've been able to send emails using a recordset, typing in the Subject, CC and Remarks in a form. It works very well. However, I cannot make the Attachment.Add work!! I'm quite frustrated! Please help! I am typing in the path in the form: ........... Set AttachmentPath = Forms!MAIL[Attachment] .... 'Add the attachment to the e-mail message. If Not IsMissing(AttachmentPath) Then Set objOutlookAttach = .Attachments.Add(AttachmentPath) End If |
#4
|
|||
|
|||
![]()
Thanks, Eric and Sue for replying.
I tried Eric's suggestion but it did not work. I deleted "Set AttachmentPath = Forms!MAIL[Attachment] " and entered Eric's suggestion, but it does not insert the attachment. I would like to have the Attachment File Name on the form, just as the cc addresses... Thanks for your help. I really appreciate it. |
#5
|
|||
|
|||
![]()
Sue,
I took the 'set' out and it did read it as a string, however the problem lies in the objOutlookAttach Set objOutlookAttach = .Attachments.Add(AttachmentPath) When I debug the objOutlookAttach = nothing while Attachment Path = c:\test.doc gives the correct path. Any other suggestions? Thanks. |
#6
|
|||
|
|||
![]()
What is a typical value for AttachmentPath from one of your actual data records? Have you checked to make sure that it points to an actual file?
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Liz" wrote in message oups.com... Sue, I took the 'set' out and it did read it as a string, however the problem lies in the objOutlookAttach Set objOutlookAttach = .Attachments.Add(AttachmentPath) When I debug the objOutlookAttach = nothing while Attachment Path = c:\test.doc gives the correct path. "Sue Mosher [MVP-Outlook]" wrote in message ... Wouldn't it be: AttachmentPath = Forms!MAIL[Attachment] to set a string rather than an object? "Myriam" wrote in message ... Hello, everyone, I'm trying to send e-mails to my clients with an attachment. I'm using Office 2003. I've been able to send emails using a recordset, typing in the Subject, CC and Remarks in a form. It works very well. However, I cannot make the Attachment.Add work!! I'm quite frustrated! Please help! I am typing in the path in the form: ........... Set AttachmentPath = Forms!MAIL[Attachment] .... 'Add the attachment to the e-mail message. If Not IsMissing(AttachmentPath) Then Set objOutlookAttach = .Attachments.Add(AttachmentPath) End If |
#7
|
|||
|
|||
![]()
I did have a typo that my eyes were not catching... It's working
perfect now. Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
send emails | mf760 | Outlook - General Queries | 6 | May 18th 06 05:47 PM |
Why do emails send twice? No attachments | Ron | Outlook - Using Contacts | 0 | April 7th 06 07:29 PM |
can't send emails | curleecues | Outlook Express | 8 | April 6th 06 03:17 PM |
CANT SEND EMAILS!!! | Cat | Outlook Express | 3 | March 31st 06 10:56 AM |
Cannot send emails | Axel | Outlook Express | 7 | January 29th 06 11:12 PM |