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
Word MVP web site
http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Maroubramick wrote:
> Does anybody know how to insert a document file name and NOT include
> the file name extesion eg ".doc". Surely there is a switch so the
> filename can be shown without the extension?