Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-09-23
11
Medium Priority
?
988 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:Anthony K O365
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 2
  • 2
11 Comments
 
LVL 71

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:Anthony K O365
ID: 33758232
Is it possible to automate copying an email attachment (particularly a zipped file) to network share?
0
Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
LVL 71

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 2000 total points
ID: 33769309
0
 
LVL 31

Assisted Solution

by:MegaNuk3
MegaNuk3 earned 2000 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 2000 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:Anthony K 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

730 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