Filename in header without ".doc"

J

James Kendall

Is there a way to get the Filename to show up without the ending ".doc"?
If there is can you please let me know how to do it.
 
S

Suzanne S. Barnhill

Only if you don't have file extensions displayed on your machine. And this
is no guarantee that the extension will not be displayed on another machine
on which they are not hidden.
 
J

James Kendall

Alternately speaking is there a way to only show the first 6 characters of
the filename using a macro or something. The way the files are I could get
away with doing it this way and accomplish the same thing.
--
Thank you for your time.
Windows XP
Office 2002


Suzanne S. Barnhill said:
Only if you don't have file extensions displayed on your machine. And this
is no guarantee that the extension will not be displayed on another machine
on which they are not hidden.
 
G

Graham Mayor

If you want the filename in the document then insert it with one of the
following macros

Sub InsertfNameAndPath()
Dim pPathname As String
With ActiveDocument
If Not .Saved Then
.Save
End If
pPathname = Left$(.FullName, (Len(.FullName) - 4))
End With
Selection.TypeText pPathname
End Sub

Sub InsertFnameOnly()
Dim pPathname As String
With ActiveDocument
If Not .Saved Then
.Save
End If
pPathname = Left$(.Name, (Len(.Name) - 4))
End With
Selection.TypeText pPathname
End Sub

If you want it in the Word Window header see Jezebel's answer
http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Top