How do I make .doc NOT display at the end of the name?

R

Riddy

When I name and document in Word and save it, it automatically displays .doc
at the end of it, both at the top of the screen and also when I go to open a
file in Word. This means that when I put a field in my footer to put the
document name, it is also putting .doc at the end of it which I naturally
don't want displayed in the footer of my document.
 
H

Herb Tyson [MVP]

..doc is part of the file name. In the Windows operating system, file
extensions are how it identifies what program opens what. In Word itself,
unless you use a macro to intervene, you're pretty much stuck with .doc when
using the filename field.

You can enclose the entire file name in quotes when saving (e.g., "this is
my file name"), which will force Word to save without an extension. But, you
will no longer see a Word icon when you look at the file in Windows Explorer
or Word's file dialogs... nor will you be able to open those files by
double-clicking in Windows Explorer (at least not in any useful way).
Windows doesn't like files not to have extensions.

If you want something without .doc in the footer, why not use document
title, instead? You can make it whatever you like--even the file name
without the .doc, if you prefer. You can then put this into a document
footer using the { title } field.

If you're using Word 2003, you can set the document title using File -
Properties - Summary tab, Title field. In Word 2007, choose Office button -
Prepare - Properties.
 
J

Jay Freedman

When I name and document in Word and save it, it automatically displays .doc
at the end of it, both at the top of the screen and also when I go to open a
file in Word. This means that when I put a field in my footer to put the
document name, it is also putting .doc at the end of it which I naturally
don't want displayed in the footer of my document.

In the File > Properties dialog, fill in the Title field with what you want to
show in the footer. Then, in the footer, replace the Filename field with a Title
field -- that will show what you typed in the Properties dialog, independent of
the file name.
 
G

Graham Mayor

Word's filename field will not show the extension if you have Windows
Explorer file options set to hide the extension for known file types, which
is the default setting (though most people change it). However an
alternative solution to those suggested would be to use a macro to insert
the filename e.g. the following will insert the filename and path or just
the filename at the cursor 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

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top