Well, then I'm convinced. My solution is the best one.
Unless the document has not been saved, then this fails
[VBA]
left(ActiveDocument.Name, instrrev(ActiveDocument.Name, ".") -1)
[/VBA]
Maybe
[VBA]
Option Explicit
Function JustTheName(Optional sFile As String = vbNullString) As String
Dim i As Long
If Len(sFile) = 0 Then sFile = ActiveDocument.Name
i = InStrRev(sFile, ".")
If i = 0 Then
JustTheName = sFile
Else
JustTheName = Left(sFile, i - 1)
End If
End Function
Sub test()
MsgBox JustTheName
MsgBox JustTheName("c:\My Documents\My Doc.SubCat.SubSubCat.docx")
MsgBox JustTheName("My Documents\My Doc.SubCat.SubSubCat.docx")
End Sub
[/VBA]
Paul