View Single Post
  #5   Report Post  
Posted to microsoft.public.word.pagelayout
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Filename in header without ".doc"

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


James Kendall wrote:
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.

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.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

"James Kendall" wrote in
message ...
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.
--
Thank you for your time.
Windows XP
Office 2002