This guide uses a VB script copied from https://techniclee.wordpress.com/2013/05/09/export-outlook-folders-to-the-file-system/ as it’s basis.
The script here only copies emails from Outlook with no option for deleting the emails, for another layer of safety the deletion is left to the user to complete manually.
The script will copy all emails from a selected folder, including subfolders, into Windows and retain each email’s attachments, sender and recipient addresses along with the timestamp information relating to the email (not the creation date within Windows).
I’ve copied the edited script below for reference, thanks to the Keble IT Manager and a few of my own edits too I have a slightly improved version which handles errors better, this is available at the end of this article.
The process for importing this script to users is manual, thankfully only a handful of people require it so it’s not a huge overhead. The deployment process is:
From within Outlook:
This creates a new tab with the script loaded into a single command named “Export” on the Outlook ribbon. The script doesn’t *ever* delete mail from Outlook, it only ever copies. To use the script:
'On the next line edit the starting folder as desired. If you leave it blank, then the starting folder will be the local computer. Const STARTING_FOLDER = "" Dim objFSO As Object Sub CopyOutlookFolderToFileSystem() ExportController "Copy" End Sub 'Sub MoveOutlookFolderToFileSystem() ' ExportController "Move" 'End Sub Sub ExportController(strAction As String) Dim olkFld As Outlook.MAPIFolder, strPath As String, dest As String strPath = SelectFolder(STARTING_FOLDER) If strPath = "" Then MsgBox "You did not select a folder. Export cancelled.", vbInformation + vbOKOnly, "Export Outlook Folder" Else Set objFSO = CreateObject("Scripting.FileSystemObject") Set olkFld = Application.ActiveExplorer.CurrentFolder ExportOutlookFolder olkFld, strPath If LCase(strAction) = "move" Then olkFld.Delete Else dest = strPath & "\" & olkFld.Name MsgBox "Now check that the right number of messages and folders are in " & dest & ", then delete the folder from Outlook" End If End If Set olkFld = Nothing Set objFSO = Nothing End Sub Sub ExportOutlookFolder(ByVal olkFld As Outlook.MAPIFolder, strStartingPath As String) Dim olkSub As Outlook.MAPIFolder, olkItm As Object, strPath As String, strMyPath As String, strSubject As String, intCount As Integer, s As String, d As Date, f As String, itemlist As Outlook.items On Error Resume Next ' Set an initial date just in case first item is broken d = Date strPath = strStartingPath & "\" & olkFld.Name objFSO.CreateFolder strPath ' Folder exists If Err.Number = 58 Then Dim rc As Integer rc = MsgBox("The folder " & strPath & " already exists, proceed anyway?", vbOKCancel) If rc = 1 Then Err.Clear Else Exit Sub End If End If Set itemlist = olkFld.items itemlist.Sort "[SentOn]", False For Each olkItm In itemlist ' Start with clean slate Err.Clear s = RemoveIllegalCharacters(olkItm.Subject) If Err.Number <> 0 Then s = "[Error in subject]" Err.Clear End If f = RemoveIllegalCharacters(olkItm.SenderName) If Err.Number <> 0 Then f = "[Error in sender]" Err.Clear End If ' This may fail in very rare circumstances. It'll use the date of the previous item as we've not reset it. That's probably close enough as the items are sorted into ascending date order. d = olkItm.SentOn strSubject = "[From] " & f & " [Subject] " & s strFilename = strSubject & ".msg" intCount = 0 Do While True strMyPath = strPath & "\" & strFilename If objFSO.FileExists(strMyPath) Then intCount = intCount + 1 strFilename = strSubject & " (" & intCount & ").msg" Else Exit Do End If Loop olkItm.SaveAs strMyPath, olMSG ChangeTimeStamp strMyPath, d Next For Each olkSub In olkFld.Folders ExportOutlookFolder olkSub, strPath Next Set olkFld = Nothing Set olkItm = Nothing End Sub Function SelectFolder(varStartingFolder As Variant) As String ' This function is a modified version of the SelectFolder function written by Rob van der Woude (http://www.robvanderwoude.com/vbstech_ui_selectfolder.php) ' Standard housekeeping Dim objFolder As Object, objShell As Object ' Custom error handling On Error Resume Next ' Create a dialog object Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.BrowseForFolder(0, "Select the folder you want to export to", 0, varStartingFolder) ' Return the path of the selected folder If TypeName(objFolder) <> "Nothing" Then SelectFolder = objFolder.self.Path ' Standard housekeeping Set objFolder = Nothing Set objShell = Nothing On Error GoTo 0 End Function Function RemoveIllegalCharacters(strValue As String) As String ' Purpose: Remove characters that cannot be in a filename from a string.' ' Written: 4/24/2009' ' Author: BlueDevilFan' ' Outlook: All versions' RemoveIllegalCharacters = strValue ' RemoveIllegalCharacters = LCase(RemoveIllegalCharacters) RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "<", "(") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, ">", ")") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, ":", "-") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, Chr(34), "'") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "/", "") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "\", "") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "|", "") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "?", "") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "*", "") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "+", "") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "@", "_at_") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, Chr(9), "") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "û", "u") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "ü", "u") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "à", "a") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "ç", "c") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "é", "e") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "è", "e") RemoveIllegalCharacters = Replace(RemoveIllegalCharacters, "ê", "e") End Function Sub ChangeTimeStamp(strFile As String, datStamp As Date) Dim objShell As Object, objFolder As Object, objFolderItem As Object, varPath As Variant, varName As Variant varName = Mid(strFile, InStrRev(strFile, "\") + 1) varPath = Mid(strFile, 1, InStrRev(strFile, "\")) Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.NameSpace(varPath) Set objFolderItem = objFolder.ParseName(varName) objFolderItem.ModifyDate = CStr(datStamp) Set objShell = Nothing Set objFolder = Nothing Set objFolderItem = Nothing End Sub
|#||Used to add a comment, except when used as #, or as #!when starting a script|
|\||Used at the end of a line to indicate continuation on to the next line|
|;||Used to interpret what follows as a new command|
|$||Indicates what follows is a variable|
> 1. Open a Finder window then from the menu bar click Go > Go to Folder
> 2. Type or copy paste the following: /Library/Internet Plug-Ins
> 3. Click Go.
> 4. If you see the: [AdobePDFViewer] plugin in the Internet Plug-Ins folder, move it to the trash.
> 5. Quit and relaunch Safari
1. GUID Partition USB Disk
2. Assuming the downloaded install is in /Applications:
sudo /Applications/Install OS X Yosemite.app/Contents/Resources/createinstallmedia –volume /Volumes/Untitled –applicationpath /Applications/Install OS X Yosemite.app –nointeraction
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
props to http://forums.macrumors.com/showthread.php?t=433407
Modifying PDFs with pdftk
At times, you may want to merge, split, or rotate PDF files; not all of these operations can be achieved while using a PDF viewer. A great way to do this is to use the “PDF Toolkit”, pdftk, to perform a very large variety of sophisticated tasks. Some of these operations include:
In short, there’s very little pdftk cannot do when it comes to working with PDF files; it is indeed the Swiss Army knife of PDF tools.
You can accomplish a wide variety of tasks using pdftk including:
|pdftk 1.pdf 2.pdf cat output 12.pdf||Merge the two documents 1.pdf and 2.pdf. The output will be saved to 12.pdf.|
|pdftk A=1.pdf cat A1-2 output new.pdf||Write only pages 1 and 2 of 1.pdf. The output will be saved to new.pdf.|
|pdftk A=1.pdf cat A1-endright output new.pdf||Rotate all pages of 1.pdf 90 degrees clockwise and save result in new.pdf.|
Encrypting PDF Files
If you’re working with PDF files that contain confidential information and you want to ensure that only certain people can view the PDF file, you can apply a password to it using the user_pw option. One can do this by issuing a command such as:
$ pdftk public.pdf output private.pdf user_pw PROMPT
When you run this command, you will receive a prompt to set the required password, which can have a maximum of 32 characters. A new file, private.pdf, will be created with the identical content as public.pdf, but anyone will need to type the password to be able to view it.
Using Additional Tools
You can use other tools, such as pdfinfo, flpsed, and pdfmod to work with PDF files.
pdfinfo can extract information about PDF files, especially when the files are very large or when a graphical interface is not available.
flpsed can add data to a PostScript document. This tool is specifically useful for filling in forms or adding short comments into the document.
pdfmod is a simple application that provides a graphical interface for modifying PDF documents. Using this tool, you can reorder, rotate, and remove pages; export images from a document; edit the title, subject, and author; add keywords; and combine documents using drag-and-drop action.
For example, to collect the details of a document, you can use the following command:
$ pdfinfo /usr/share/doc/readme.pdf
Converting Between PostScript and PDF
Most users today are far more accustomed to working with files in PDF format, viewing them easily either on the Internet through their browser or locally on their machine. The PostScript format is still important for various technical reasons that the general user will rarely have to deal with.
From time to time you may need to convert files from one format to the other, and there are very simple utilities for accomplishing that task. ps2pdf and pdf2ps are part of the ghostscript package installed on or available on all Linux distributions. As an alternative, there are pstopdf and pdftops which are usually part of the poppler package which may need to be added through your package manager. Unless you are doing a lot of conversions or need some of the fancier options (which you can read about in the man pages for these utilities) it really doesn’t matter which ones you use.
Some usage examples:
|pdf2ps file.pdf||Converts file.pdf to file.ps
|ps2pdf file.ps||Convertsfile.ps to file.pdf
|pstopdf input.ps output.pdf||Converts input.ps to output.pdf|
|pdftops input.pdf output.pdf||Converts input.pdf to output.ps|
lp and lpr accept command line options that help you perform all operations that the GUI can accomplish. lp is typically used with a file name as an argument.
Some lp commands and other printing utilities you can use are listed in the table.
|lp <filename>||To print the file to default printer|
|lp -d printer <filename>||To print to a specific printer (useful if multiple printers are available)|
|program | lp
echo string | lp
|To print the output of a program|
|lp -n number <filename>||To print multiple copies|
|lpoptions -d printer||To set the default printer|
|lpq -a||To show the queue status|
|lpadmin||To configure printer queues|
The lpoptions utility can be used to set printer options and defaults. Each printer has a set of tags associated with it, such as the default number of copies and authentication requirements. You can execute the command lpoptions help to obtain a list of supported options. lpoptions can also be used to set system-wide values, such as the default printer.
|lpstat -p -d||To get a list of available printers, along with their status|
|lpstat -a||To check the status of all connected printers, including job numbers|
|To cancel a print job|
|lpmove job-id newprinter||To move a print job to new printer|
Working with enscript
enscript is a tool that is used to convert a text file to PostScript and other formats. It also supports Rich Text Format (RTF) and HyperText Markup Language (HTML). For example, you can convert a text file to two column (-2) formatted PostScript using the command: enscript -2 -r -p psfile.ps textfile.txt. This command will also rotate (-r) the output to print so the width of the paper is greater than the height (aka landscape mode) thereby reducing the number of pages required for printing.
The commands that can be used with enscript are listed in the table below (for a file called ‘textfile.txt’).
|enscript -p psfile.ps textfile.txt||Convert a text file to PostScript (saved to psfile.ps)|
|enscript -n -p psfile.ps textfile.txt||Convert a text file to n columns where n=1-9 (saved in psfile.ps)|
|enscript textfile.txt||Print a text file directly to the default printer
|$ zcat compressed-file.txt.gz||To view a compressed file|
|$ zless <filename>.gz
$ zmore <filename>.gz
|To page through a compressed file|
|$ zgrep -i less test-file.txt.gz||To search inside a compressed file|
|$ zdiff filename1.txt.gz
|To compare two compressed files|
Launch Chrome with command line flag:
This can be added to the end of the shortcut “Target” field in Windows