Quite often because I’ve opened a document from a shortcut or as an attachment I’m not sure where the document is actually located. This little macro opens the folder with the document itself selected. Thanks to Hans for his contribution.
The same macro can work with Word, Excel and Powerpoint documents
Sub FindMe() ' 'Macro created 25_June_2006 by Owen Gwynne ' Dim Here_I_am As String Dim OK As Double Dim What_I_am As String Dim Mypath As String Dim My_Name as String What_I_am = Application.Name If What_I_am = "Microsoft Word" Then Mypath = ActiveDocument.Path My_Name = ActiveDocument.Name ElseIf What_I_am = "Microsoft Excel" Then Mypath = ActiveWorkbook.Path My_Name = ActiveWorkbook.Name ElseIf What_I_am = "Microsoft PowerPoint" Then Mypath = ActivePresentation.Path My_Name = ActivePresentation.Name End If If Mypath = "" Then OK = MsgBox("File Not Saved, no current folder defined", vbOKOnly) Else Here_I_am = "explorer /n, """ & Mypath Here_I_am = Here_I_am & """ , /select,""" Here_I_am = Here_I_am & Mypath & "" & My_Name & """" OK = Shell(Here_I_am, vbNormalFocus) End If End Sub