Anyway to get just the path without the filename?

S

Sesquipedalian Sam

I can use the Filename field with the \p switch to get the filename
including the path ({FILENAME \p }).

Is there any way to get just the path without the filename?
 
S

Sesquipedalian Sam

I'm curious: What good is the path without a file name?

I want to display them separately -- either on separate lines or in
separate columns of a table.
 
T

Terry Farrell

I am sure you cannot. The \p is a 'field specific' switch (i.e. it only
works with FILENAME).
 
G

Graham Mayor

Not with fields, but it is simple enough to achieve with a macro

Sub InsertPath()
With ActiveDocument
If Len(.Path) = 0 Then .Save
Selection.TypeText .Path & "\"
End With
End Sub

http://www.gmayor.com/installing_macro.htm

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