Discussion Locked

Outlook 2000: how can I save an attachme

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm in the need to save an attachment received in a message in Outlook 2000 in a determined folder in my hard disk.
Is there someone that could suggest me an example of VBScript or Outlook 2000 macro in order to make this operation in automatic?
Thanking You.
Andrea Bettoni

5 replies

by zalog

I am currently doing this via the Rules Wizzard and a 3rd party custom action called CaSaveAtt. It is available at http://www.ornic.com. Aside from automatically doing a "Save As...", the utility will also allow you to execute a program after the save.

by kelsaidi

YES,
Open OutLook Tools - Macro - Visual Basic
Select ThisOutLookSession from the Left Bar
Select Application from the first list (Left)
Select NewMail from the second list (Right)
Insert the following Lines After "Private Sub Application_NewMail()"

Dim Nmail As MailItem
Dim nSpace As NameSpace

Set nSpace = Application.GetNamespace("MAPI")
'CHANGE HERE TO FIT FOLDERS
Set CurrentFolder = nSpace.Folders.Item("Outlook Today").Folders.Item("InBox")
Set MyInBox = CurrentFolder.Items
Set Nmail = PostaInArrivo.GetLast
For I% = 1 To Nmail.Attachments.Count
Nmail.Attachments.Item(I%).SaveAsFile "C:\PUBLIC\" & Nmail.Attachments.Item(I%).FileName
Next
Set Nmail = Nothing
Set nSpace = Nothing

by andy bettoni

I tried this code rows but they didn't work properly. Perhaps I forgot something but now I do not have time to try some debug. Thanks!

This discussion is closed to new replies.