Retrieving Files Via Email

Retrieving Files Via Email
This post was previously published. It has been updated.

=

I am a computer consultant. There are a lot of advantages, but one of the disadvantages is that I don’t have access to all my files everywhere.

I understand why system administrators are strict about access to files: I currently am assigned to a bank, and you don’t want people not authorized to get to any of the data (not that I have access to the core banking system…)

But sometimes I need access to something I have left on my client hard drive. This came to light recently when I was asked to edit my resume for my company. It’s a thing I have to do once a year so that my company has a current resume to put before clients. I had some down time at my client, so I downloaded the resume to my hard drive and started adjusting it.

But then after hours there was a call for the item, and my remote desktop wasn’t working, so I couldn’t email it to myself.

I remembered back in the days when I had created a programmatic solution to the problem.

All it needs is to have the programming installed inside Outlook, the allowed email addresses adjusted, and then Outlook to be running on the computer.

Please note, this was programmed for, and the instructions that follow, are for Outlook 365 for Windows. I do not guarantee that it will work on any other version of Outlook, nor do I make any warranties or guarantees about the code. I also do not take responsibility for your use of this code to violate rules/policies at your workplace. Use at your own risk.

I made the script so it will only process requests from emails in the script itself (rather than relying on Outlook rules), and an option to log any attempts to retrieve files in an Outlook note. You can download the script file here.

Installing The Script

To install it, copy the text in the script file. Run Outlook, then open up Developer/Visual Basic, and choose Module from the Insert menu. Paste in the code. Change the addresses and file prefix to your choice in the SetOptions section. Make sure to save and exit, and exit Outlook to save the script.

If you do not have the Developer menu, go to the File/Options/Customize Ribbon and check the Developer checkbox.

Set Up The Rule

From the Home menu, choose Rules from the toolbar. Click on New Rule, and follow the Rules Wizard. You need to apply to messages after they arrive, checking the subject for SMFile (or whatever key phrase you wish to put in to trigger the rule), and run the script SendMyFiles.

If you don’t see Run A Script as one of the options, please see the article in how to enable it here.

Set Up A Certificate/Trust Macros

Outlook will not run macros by default (they are considered unsafe). You have two choices: either enable for all macros, or set up a digital certificate. Both of these are beyond the scope of this article, but you can find lots of information on Google.