does anyone know if you can write code (in VB or anything else!) that can automate the dowbnload of an attachment - when a certain e-mail comes in the user would like to press a "button" and automatically have the attachment downloaded to a specified folder.
This is the kind of thing I use. Add it to a vbs or vba program and run it when an email arrives or alternatively add it to scheduled tasks to check every now and then...
Dim mliNew As MailItem
Dim ns As NameSpace
Dim oOutlook As Outlook.Application
Set oOutlook = New Outlook.Application
Set ns = oOutlook.GetNamespace("MAPI")
Set mfrInbox = ns.GetDefaultFolder(olFolderInbox)
With mfrInbox
If .Items.Count = 0 Then
MsgBox "There are no messages in the Inbox.", vbInformation, "Nothing Found"
Else
.Items.Sort "Received", True
'check all e-mails sent today
For Each mliNew In .Items
If mliNew.sendername = "myfriend" Then
mliNew.Attachments.Item(1).SaveAsFile sMyNewFile
Else
Exit For
End If
Next
End If
End With
Main_Exit:
Set mliNew = Nothing
Set ns = Nothing
Set oOutlook = Nothing
Exit Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.