#1   Report Post  
Posted to microsoft.public.word.pagelayout
koala824 at Comcast koala824 at Comcast is offline
external usenet poster
 
Posts: 18
Default FILENAME Field

Is there any way to use this field so that the filename that shows does NOT
include the file extension? I want to use the filename in my header, but do
not want the .DOC extension to show. Thanks


  #2   Report Post  
Posted to microsoft.public.word.pagelayout
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default FILENAME Field

This is a Windows setting. If you have extensions displayed in Windows, they
will be in Word as well.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"koala824 at Comcast" wrote in message
...
Is there any way to use this field so that the filename that shows does
NOT include the file extension? I want to use the filename in my header,
but do not want the .DOC extension to show. Thanks



  #3   Report Post  
Posted to microsoft.public.word.pagelayout
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default FILENAME Field

If you want to retain the field then as Suzanne suggests you need to change
the Windows display of extensions, which will not help if others open the
document. In any case it is most helpful to display extensions in Windows,
so not that pratical. You can instead use a macro to insert the filename or
filename and path without extension eg

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

and the following will type the filename without extension in the current
page header

Sub InsertFilenameinHeader()
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
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.TypeText pPathname
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub

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


koala824 at Comcast wrote:
Is there any way to use this field so that the filename that shows
does NOT include the file extension? I want to use the filename in my
header, but do not want the .DOC extension to show. Thanks



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding field names to filename Peter Microsoft Word Help 2 November 28th 06 11:31 AM
Form field-- Filename Ray Microsoft Word Help 1 March 24th 06 06:28 PM
Field Filename Eric Page Layout 2 September 13th 05 01:14 PM
how do I add a filename field to a template DavidArn1711 Microsoft Word Help 2 April 19th 05 05:18 AM
filename field switches - anything besides /p? Anita Aldrich via OfficeKB.com Microsoft Word Help 1 March 3rd 05 10:14 AM


All times are GMT +1. The time now is 11:34 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"