Re: Outlook Attachments
Attachments.Add takes 4 arguments, all but the first one are optional. The
last one is DisplayName:
MyAttachments.Add(slFileList[i], olByValue, -1, 'Todays Attachment')
Note that Outlook 2003 ignores the display name and always uses the file
name. Whether this is a bug that will be fixed or a feature against
malicious e-mails I do not know at this point.
Dmitry Streblechenko (MVP)
www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Peter Batten" <
XXXX@XXXXX.COM>writes
Quote
Thanks again Dmitry
It was the syntax. What you have written works. How then do I name an
attachment specifically ie, 'Todays Attachment' not 'Filename.doc'? I
need to do this with a different name for each of the files in the file
list
"Dmitry Streblechenko" <XXXX@XXXXX.COM>writes
news:3fb41c3c$XXXX@XXXXX.COM...
>No, the syntax is exactly the same, but it should be
>MyAttachments.Add(slFileList[i], olByValue)
>Don't forget to save the message afterward though (MyNewMail.Save)
unless
it
>is up to a user.
>
>Dmitry Streblechenko (MVP)
>www.dimastr.com/
>OutlookSpy - Outlook, CDO
>and MAPI Developer Tool
>
>
>"Peter Batten" <XXXX@XXXXX.COM>writes
>news:XXXX@XXXXX.COM...
>>Is there any difference between Outlook 2000 and Outlook XP syntax or
>>methods for adding multiple attachments?
>>
>>I am using the following
>>
>>MyAttachments := MyNewMail.Attachments;
>>For i := 0 to slFileList.Count - 1 do
>>MyAttachments(slFileList[i], olByValue, 1, slFileList[i]);
>>
>>This works correctly for Outlook XP but I only get 1 file for Outllok
2000
>>
>>TIA
>>
>>Peter
>>
>>
>
>