Adding Attachments using VBA 
Author Message
 Adding Attachments using VBA

Anyone knows how I do to add an attachment to a MailItem or
AppointmentItem that I have created?

I do CreateItem, add som stuff, and before closing I want to add an
attachment to that object, but I cannot figure out how, I am not even
sure that it is possible...

Hoping for an answer!



Fri, 07 Feb 2003 03:00:00 GMT  
 Adding Attachments using VBA
Assume that objMsg is a valid MailItem object. (even one built on a custom
form)

With objMsg
    ' Fill in the To, Subject, .etc
    .Attachments.Add "C:\My Documents\Q496.xls", _
    olByValue, 1, "4th Quarter 1996 Results Chart"
End With
objMsg.Display

AppointmentItems also support the Attachments object so the code would be
the same as above.

Quote:

> Anyone knows how I do to add an attachment to a MailItem or
> AppointmentItem that I have created?

> I do CreateItem, add som stuff, and before closing I want to add an
> attachment to that object, but I cannot figure out how, I am not even
> sure that it is possible...

> Hoping for an answer!



Fri, 07 Feb 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. add an attachment with VBA

2. How to insert attachment as text using vba

3. add name of attachment to Subject line and delete attachment

4. OL2000: Can I zip attachments using VBA?

5. Deleting attachments using VBA

6. Saving attachments using VBA?

7. Adding multiple attachments from File System using VBScript

8. Add Email Attachment Using Command Line

9. adding columns to a table using VBA and addressing them

10. Using VBA to add mailmessages

11. How to add fields to a table using VBA

12. newbie - adding records to a table using VBA

 

 
Powered by phpBB® Forum Software