Page 1 of 1

Email attachments automatisch opslaan?

Posted: Mon Mar 01, 2010 10:40 am
by DJF3
Hi,

Is het mogelijk om attachments van bepaalde emails automatisch te saven?

Ik heb bijv. bepaalde status informatie die via email binnenkomt. Deze status informatie wil ik gebruiken in een HS device.
Deze informatie staat in een .csv of .txt attachment van een bepaald email account dat ik heb.

-Hoe kan ik attachments van HS 'monitored' email addresses saven op een vaste locatie?


Groeten
DJ

Re: Email attachments automatisch opslaan?

Posted: Mon Mar 01, 2010 12:16 pm
by Fantic
Je kunt in de meeste email clients een actie uit laten voeren gebaseerd op diverse criteria als een mail binnenkomt.
Je daar (afhankelijk van de mail client) natuurlijk ook een Save attachment actie laten uitvoeren.

Re: Email attachments automatisch opslaan?

Posted: Tue Mar 02, 2010 11:50 am
by pleaseask
Hi DJF3,

Yes that is possible.
Here is a sample vbscript that i have found on the internet couple of years ago.
I hope it is usefull

Edwin

'Description: To be used in 'stripping' attachments from
'e-mails in your inbox and save them to a hardcoded path.
'------------------------------------------------------
'This bit of code will strip attachments and save them into the path
'"C:\temp\Outlook Attachments", it has no error handling so be warned!
'Code starts (placed under a command button.)

Dim oApp As Outlook.Application
Dim oNameSpace As NameSpace
Dim oFolder As MAPIFolder
Dim oMailItem As Object
Dim sMessage As String

Set oApp = New Outlook.Application
Set oNameSpace = oApp.GetNamespace("MAPI")
Set oFolder = oNameSpace.GetDefaultFolder(olFolderInbox)

For Each oMailItem In oFolder.Items
With oMailItem
If oMailItem.Attachments.Count > 0 Then '?
oMailItem.Attachments.Item(1).SaveAsFile "C:\Temp\Outlook
Attachments\" & oMailItem.Attachments.Item(1).filename
MsgBox oMailItem.Attachments.Item(1).DisplayName & " was
saved as " & oMailItem.Attachments.Item(1).filename
End If
End With
Next oMailItem

Set oMailItem = Nothing
Set oFolder = Nothing
Set oNameSpace = Nothing
Set oApp = Nothing
DJF3 wrote:Hi,

Is het mogelijk om attachments van bepaalde emails automatisch te saven?

Ik heb bijv. bepaalde status informatie die via email binnenkomt. Deze status informatie wil ik gebruiken in een HS device.
Deze informatie staat in een .csv of .txt attachment van een bepaald email account dat ik heb.

-Hoe kan ik attachments van HS 'monitored' email addresses saven op een vaste locatie?


Groeten
DJ