Board index » delphi » Re: Outlook Attachments

Re: Outlook Attachments


2003-11-14 08:05:18 AM
delphi29
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
Quote
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


 
 

Re: Outlook Attachments

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
 

Re: Outlook Attachments

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
Quote
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
>
>


 

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


 

Re: Outlook Attachments

Third parameter is the position within the message body (applies to the RTF
format only). "-1" means "do not show inside of the message body". Or should
it me 0 in OOM? Extended MAPI uses -1, but Outlook OOM is 1 based.
Dmitry Streblechenko (MVP)
www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Peter Batten" <XXXX@XXXXX.COM>writes
Quote
Hi Dmitry,

this is what I was using which fails to give all of the attachments in
Outlook '97 and 2000 (ok in XP) , only one attachment is displayed.
MyAttachments.Add(slFileList[i], olByValue, 1, 'Todays Attachment')

What is the difference between your -1 and my 1?
MyAttachments.Add(slFileList[i], olByValue, -1, 'Todays Attachment')

Thanks

Peter

"Dmitry Streblechenko" <XXXX@XXXXX.COM>writes
news:3fb4789d$XXXX@XXXXX.COM...
>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
>news:3fb42a34$XXXX@XXXXX.COM...
>>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
>>>>
>>>>
>>>
>>>
>>
>>
>
>


 

Re: Outlook Attachments

Hi Dmitry,
this is what I was using which fails to give all of the attachments in
Outlook '97 and 2000 (ok in XP) , only one attachment is displayed.
MyAttachments.Add(slFileList[i], olByValue, 1, 'Todays Attachment')
What is the difference between your -1 and my 1?
MyAttachments.Add(slFileList[i], olByValue, -1, 'Todays Attachment')
Thanks
Peter
"Dmitry Streblechenko" <XXXX@XXXXX.COM>writes
Quote
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
news:3fb42a34$XXXX@XXXXX.COM...
>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
>>>
>>>
>>
>>
>
>