The following macros will insert the document name or document path and name
without the extension - add to keystroke shortcuts or toolbar buttons
http://www.gmayor.com/installing_macro.htm
Sub InsertfNameAndPath()
Dim pPathname As String
With ActiveDocument
If Len(.Path) = 0 Then
.Save
End If
If Right(.Name, 1) = "x" Then
pPathname = Left$(.FullName, (Len(.FullName) - 5))
Else
pPathname = Left$(.FullName, (Len(.FullName) - 4))
End If
End With
Selection.TypeText pPathname
End Sub
Sub InsertFnameOnly()
Dim pPathname As String
With ActiveDocument
If Len(.Path) = 0 Then
.Save
End If
If Right(.Name, 1) = "x" Then
pPathname = Left$(.Name, (Len(.Name) - 5))
Else
pPathname = Left$(.Name, (Len(.Name) - 4))
End If
End With
Selection.TypeText pPathname
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>