Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook - Using Forms (http://www.outlookbanter.com/outlook-using-forms/)
-   -   List attachments (http://www.outlookbanter.com/outlook-using-forms/15183-list-attachments.html)

MarkN May 19th 06 02:08 AM

List attachments
 
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,
MarkN

Hollis Paul [MVP - Outlook] May 19th 06 06:14 AM

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



Ken Slovak - [MVP - Outlook] May 19th 06 03:04 PM

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




Hollis Paul [MVP - Outlook] May 19th 06 07:26 PM

List attachments
 
In article , Ken Slovak - [MVP -
Outlook] wrote:
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:

Thanks, Ken. I guess I have never looked at what that add-in does.

--
Hollis Paul
Mukilteo, WA USA




All times are GMT +1. The time now is 09:18 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com