Open Containing Folder in MS Word
I have an open Word document. When I hit CTRL+ALT+O on my keyboard, the folder that contains that document opens. This is very handy if I want to attach the open file to an email message by dragging and dropping the filename onto the message. It’s also very handy if there are other files in that folder that I want to open.
Tip: Always save your file before attaching it to an email message. If you attach without saving, only whatever portion that was already saved will be sent.
In my last post, I discussed four options for opening the containing folder of an open Word document. The first two required navigating the folder system. The third option required a little programming, and the fourth option (Office Tab) required $25.
For those who are interested in free option #3, here are the programming instructions courtesy of Tina Ostrander in my college’s Computer Science department. (Thanks, Tina!) The original code comes from the Code for Excel and Outlook blog. While it may look scary, it took less than 5 minutes to set it up.
**************************
Tina Ostrander writes:
In Word, select the View tab. Then Click Macros, View Macro… Type a Macro name, then click Create:
Copy this code:
As String, ByVal lpFile As String, ByVal lpParameters _
As String, ByVal lpDirectory As String, ByVal nShowCmd _
As Long) As Long
Sub OpenContainingFolder()
On Error GoTo ErrorHandler
Dim currentDocPath As String
currentDocPath = ActiveDocument.Path
ProgramExit:
Exit Sub
ErrorHandler:
Resume ProgramExit
End Sub
Into the macro window, like this [Note from Sue, highlight any existing code in the box, delete it, then paste in this code.]:
Click Save and close the window.
To run the macro, select Macro
Click Assign, then Close, then OK.
**************************
That’s it! Open a Word document. Use your keyboard shortcut. The folder that contains that document will open.