A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

send emails with attchments



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 25th 06, 08:22 PM posted to microsoft.public.outlook.program_vba
Myriam
external usenet poster
 
Posts: 3
Default send emails with attchments

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  
Old May 25th 06, 08:36 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default send emails with attchments

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  
Old May 25th 06, 10:37 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default send emails with attchments

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  
Old May 25th 06, 11:11 PM posted to microsoft.public.outlook.program_vba
Liz
external usenet poster
 
Posts: 5
Default send emails with attchments

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  
Old May 25th 06, 11:39 PM posted to microsoft.public.outlook.program_vba
Liz
external usenet poster
 
Posts: 5
Default send emails with attchments

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  
Old May 25th 06, 11:47 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default send emails with attchments

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  
Old May 26th 06, 05:50 AM posted to microsoft.public.outlook.program_vba
Liz
external usenet poster
 
Posts: 5
Default send emails with attchments

I did have a typo that my eyes were not catching... It's working
perfect now. Thanks!

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 12:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.