Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save mail Attachments ?

Status
Not open for further replies.

Dttrue

Programmer
Dec 6, 2002
16
GB
Hi there ,
How do I save mail attachment/s , as and when they arrive in the Inbox (Microsoft Outlook 2000), without any manual intereference . SOme kind of a VB script ,which runs with Rules Wizard.

ANy help is much appreciated.


Thanks & regards

rk
 
This will do the job, but you may want to go though it to customise it for your job.


Dim Outlook
Set Outlook = CreateObject("Outlook.Application")

FilePath = "c:\temp" 'attachment will be saved here

k = 1
j = Outlook.Session.Folders.Count

For i = 1 To Outlook.Session.Folders.Item(j).Folders.Count
Set Folder_Item = Outlook.Session.Folders.Item(j).Folders.Item(i)

If Folder_Item.Name = "Inbox" Then

For Each Mail_Item In Folder_Item.Items
IsTifFile = False

For Each Att_Item In Mail_Item.Attachments

FileName = FilePath & "\" & att_item
Att_Item.SaveAsFile FileName
k = k + 1
IsTifFile = True
Next
Next
End If
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top