Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Maroubramick Maroubramick is offline
external usenet poster
 
Posts: 1
Default insert filename without extension .doc using fields?

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?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default insert filename without extension .doc using fields?

There is a "switch," but it's in Windows and applies to all files.

--
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.

"Maroubramick" wrote in message
...
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?


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default insert filename without extension .doc using fields?

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?



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
field code to return the filename without the extension kuma-kami Microsoft Word Help 2 April 27th 07 06:01 AM
How can I remove the .doc file extension in a FILENAME field? Mike Petrusko Microsoft Word Help 2 March 18th 06 06:24 AM
Can I insert a filename when I insert a picture into word? tpbIII Microsoft Word Help 2 March 13th 06 11:13 AM
Insert > Autotext is missing "filename" and "filename and path"; how to get back? StargateFan New Users 7 February 7th 05 12:17 AM
Can I display the FILENAME in word without the .doc extension? Mr P Microsoft Word Help 1 January 15th 05 10:45 AM


All times are GMT +1. The time now is 08:15 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"