View Single Post
  #3  
Old May 19th 06, 03:04 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default List attachments

No, Attachment Options is just for setting the registry key for blocked
attachments, it has nothing to do with what attachments are in an email.

The OP doesn't mention where the code is going to run, which is important.
If say it's running as a VBA macro that's run from a button on a toolbar on
a selected item:

Sub AttachmentsList()
Dim oMail As Outlook.MailItem
Dim colAttach As Outlook.Attachments
Dim oAttach As Outlook.Attachment
dim strAttach As String

Set oMail = Application.ActiveExplorer.Selection.Item(1)
Set colAttach = oMail.Attachments
For Each oAttach In colAttachments
strAttach = strAttach & vbCRLF & oAttach.DisplayName
Next

oMail.Body = oMail.Body & strAttach
oMail.Save
End Sub

That would write, one per line, a list of all attachment display names at
the end of the message body into that message. The message would be the one
currently selected in the folder view. No error checking in that sample,
that's an exercise for the reader.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Hollis Paul [MVP - Outlook]" wrote in message
...
In article ,
=?Utf-8?B?TWFya04=?= wrote:
Outlook 2003. Could anyone point me in the direction of some code that
will
list the names of any attachments after the text of the email (either
automatically or when the user "runs" the code.
--
Any help greatfully appreciated,

Check to see if the Attachment Options at

http://www.slovaktech.com/attachmentoptions.htm

does what you want.

--
Hollis Paul
Mukilteo, WA USA



Ads