Solved

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

Posted on 2010-09-23
11
979 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:kt KTAdmin
  • 7
  • 2
  • 2
11 Comments
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
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
Comment Utility
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:kt KTAdmin
Comment Utility
Is it possible to automate copying an email attachment (particularly a zipped file) to network share?
0
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
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
Comment Utility
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 31

Assisted Solution

by:MegaNuk3
MegaNuk3 earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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:kt KTAdmin
Comment Utility
This is what I was looking for. Thanks!
0
 
LVL 31

Expert Comment

by:MegaNuk3
Comment Utility
No problem, thanks for the points
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
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…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now