Help - Want to add attachment to mapi email 
Author Message
 Help - Want to add attachment to mapi email

I'm a newbie when it comes to mapi, and I am trying to do a send to and add
an
attachment to the mail message. Here is the test code I am using

        MAPISession1.DownLoadMail = False
        MAPISession1.SignOn

        MAPIMessages1.SessionID = MAPISession1.SessionID
        MAPIMessages1.MsgIndex = -1
        MAPIMessages1.Compose
        MAPIMessages1.AttachmentIndex = 1
        MAPIMessages1.AttachmentPathName = AValidPathName
        MAPIMessages1.AttachmentName = "test.txt"
        MAPIMessages1.AttachmentType = mapData
        MAPIMessages1.Send True

        MAPISession1.SignOff

If I don't add the attachment, my email window comes up and I can compose
and send, so the mapi
stuff is basically working. With the code above, I get Mapi error 32011 -
Attachment not found.

I know the file I exists, so there must be something I am missing here. I've
tried moving the
order of the method calls around, inserting a small string in the msg first
and then
specifiying the attachment position. Always get the same response - can't
find the attachment.

Can anybody help?

Thanks,

Peter



Sun, 28 Oct 2001 03:00:00 GMT  
 Help - Want to add attachment to mapi email
I found my problem, changed the index to 0 (thought I tried that before?).
Anyway, seems to work fine now. Sorry for wasting people's time <G>

Thanks,

Peter



Sun, 28 Oct 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using MAPI and Outlook to send email attachments?

2. sending email attachments with the MAPI control

3. eMail-Attachments using MAPI-Control

4. Adding multiple attachments to a mapi message

5. Add Email Attachment Using Command Line

6. add attachments to open email

7. Adding an attachment to an email

8. I want to add attachments to emails in outlook

9. HELP : Saving Attachments using MAPI and VB6

10. HELP : Saving Attachments using VB and MAPI

11. HELP pls MAPI & Attachments

12. Help: Mapi attachments

 

 
Powered by phpBB® Forum Software