-
Hi
I've tried opening an e-mail's attachment for input but nothing happened.
I first used msgbox mailitem.attachments.count
to verify that vb realy recognizes,the attachments of the specific e-mail.
but opening the attachment for input to read the data from it(it's a text file), using:
open mailitem.attachments(1) for input as #1
coused nothing,while reading characters from the file coused n error massage (masaging that the file isn't open).
Can anyone help with the appropriate procedure to open a text file attachment for input reading.
Thanx a lot in advance
Well... Thanx a lot HDR,actually I'm aware of the array like
reference to mail attachments, and that was my original way of referencing the attachments, as mentioned in the body of the original question.
thanx Buzby you're message helped me a lot and currently, actually my problem has solved thanks to you, thank you very much again!! :)
[Edited by shmulik on 04-21-2000 at 03:36 PM]
[Edited by shmulik on 04-27-2000 at 01:14 PM]
-
Attachments are a collection of mailitem attachments. You can treat them like an array. Use the following as an example of how to access the attachments.
myAttachment = myItem.Attachments(index)
Repeat that to retrieve your stuff until you've done it:
nCounter = myItem.Attachments.Count
nCounter times.
-
If you mean you want to read the file that has been attached to an e-mail you will find that when the e-mail in question is open all the attachments can be found in the WINDOWS\TEMP directory. The Attachment object on the MSMail control tells you the filename of each attachment. I think if you try
Open MailItem.Attachments(1).Filename ... you might have more luck.
Of course you could always go to http://www.planetsourcecode.com/vb/
and search for BuzMail - this is my MSMail 'overlay' that gives you a much easier to use method to send and receive e-mails (with or without attachments). IF you like it please let me know.