MS Auto Insert in Headers

E

ergeordie

I am wondering if there is a way to use an auto insert in a header as a
template and to have that auto inserted text not show the extension at the
end? In other words, can I use some text that I have created to Auto Insert
as a header in a Word document and when I inser the text, to not have the
..doc at the end? Stefan Blom has already suggested turning off the 'Display
File extension' selector within the OS. Is there any way to deal with the
first issue? Can I use an Auto Insert as a template within a Header?

Cheers,

ergeordie
 
G

Graham Mayor

You cannot use parts of fields to derive information. What you can do is
insert the information with a macro.

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

or if you only want the filename and not the path, change each occurrence of
..FullName to .Name

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


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

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