Solved

VBscript (or batch file) for forwarding email with zipped file attachment.

Posted on 2010-09-23
11
981 Views
Last Modified: 2012-05-10
I have a Windows 2003 AD environment and I am looking for a script that will forward an email with zipped file attachments (or just the attachment) to a network folder. Any assistance is much appreciated!
0
Comment
Question by:K Anthony O365
  • 7
  • 2
  • 2
11 Comments
 
LVL 69

Expert Comment

by:Qlemo
ID: 33751513
What exactly do you mean with "forward to a network folder"? Copy the email as file, or mail it to a public folder in Exchange?
0
 
LVL 31

Expert Comment

by:MegaNuk3
ID: 33752018
Where does the script get the e-mail from or does the script generate the email with the attachments (say log files) and then send it to a PF or resource mailbox?
0
 

Author Comment

by:K Anthony O365
ID: 33758232
Is it possible to automate copying an email attachment (particularly a zipped file) to network share?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 69

Expert Comment

by:Qlemo
ID: 33758655
You want to have a means to automatically save attachments of emails on receive to a network folder? Yes, you can write some VBA code in Outlook to do that. But AFAIK there is no integrated way to do so with Exchange.
0
 
LVL 31

Accepted Solution

by:
MegaNuk3 earned 500 total points
ID: 33769309
0
 
LVL 31

Assisted Solution

by:MegaNuk3
MegaNuk3 earned 500 total points
ID: 33769357
The solution on this one seems to be exactly what you are looking for:
http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_23916589.html

A rule fires the VBA code and then saves the attachment in a location of your choice...
0
 
LVL 31

Expert Comment

by:MegaNuk3
ID: 33769387
So you would just have to change the line:
If Right(LCase(olkFile.FileName, 3)) = "csv" Then
                                 TO
If Right(LCase(olkFile.FileName, 3)) = "zip" Then

and then modify the location to save to your network location
olkFile.SaveAsFile "Z:\SavedZipFiles\" & olkFile.FileName
0
 
LVL 31

Expert Comment

by:MegaNuk3
ID: 33769418
Reading further down in that question the line should be:
If Right(LCase(olkFile.FileName),3) = "zip" Then
0
 
LVL 31

Assisted Solution

by:MegaNuk3
MegaNuk3 earned 500 total points
ID: 33769439
So your code should be similar to the following:
Sub SaveCSVToDisk(Item As Outlook.MailItem)
    Dim olkFile As Outlook.Attachment
    For Each olkFile In Item.Attachments
        'Change the file name on the following line'
        If Right(LCase(olkFile.FileName), 3) = "zip" Then
            'Change the path the file will be saved to on the following line'
            olkFile.SaveAsFile "Z:\SavedZipFiles\" & olkFile.FileName
        End If
    Next
    Set olkFile = Nothing
End Sub

Open in new window

0
 

Author Closing Comment

by:K Anthony O365
ID: 33770702
This is what I was looking for. Thanks!
0
 
LVL 31

Expert Comment

by:MegaNuk3
ID: 33770981
No problem, thanks for the points
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question