Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
field code to return the filename without the extension
I need to return to the document the filename but without the dot and extension
|
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
field code to return the filename without the extension
There is no field code in Word that will do this if you have file extensions
displayed in Windows. -- 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. "kuma-kami" wrote in message ... I need to return to the document the filename but without the dot and extension |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
field code to return the filename without the extension
But you can do it with a simple macro. Use one or other of the following
depending on whether you want the file path also. 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 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 Suzanne S. Barnhill wrote: There is no field code in Word that will do this if you have file extensions displayed in Windows. "kuma-kami" wrote in message ... I need to return to the document the filename but without the dot and extension |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I edit field code fieldname to exclude .doc extension? | Microsoft Word Help | |||
postal code with extension | Mailmerge | |||
How can I remove the .doc file extension in a FILENAME field? | Microsoft Word Help | |||
filename - field code, ? How to work ? | Microsoft Word Help | |||
Can I display the FILENAME in word without the .doc extension? | Microsoft Word Help |