A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Anyway to get just the path without the filename?



 
 
Thread Tools Display Modes
  #1  
Old November 13th, 2009, 03:56 PM posted to microsoft.public.word.newusers
Sesquipedalian Sam
external usenet poster
 
Posts: 131
Default Anyway to get just the path without the filename?

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?
  #2  
Old November 13th, 2009, 04:13 PM posted to microsoft.public.word.newusers
JoAnn Paules
external usenet poster
 
Posts: 10,630
Default Anyway to get just the path without the filename?

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

--

JoAnn Paules
MVP Microsoft [Publisher]
Tech Editor for "Microsoft Publisher 2007 For Dummies"


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



  #3  
Old November 13th, 2009, 04:22 PM posted to microsoft.public.word.newusers
Sesquipedalian Sam
external usenet poster
 
Posts: 131
Default Anyway to get just the path without the filename?

On Fri, 13 Nov 2009 11:13:10 -0500, "JoAnn Paules"
wrote:


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.
  #4  
Old November 13th, 2009, 05:20 PM posted to microsoft.public.word.newusers
Terry Farrell
external usenet poster
 
Posts: 3,004
Default Anyway to get just the path without the filename?

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

--
Terry Farrell - MSWord MVP

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


  #5  
Old November 14th, 2009, 07:45 AM posted to microsoft.public.word.newusers
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Anyway to get just the path without the filename?

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Sesquipedalian Sam wrote:
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?



  #6  
Old November 14th, 2009, 02:13 PM posted to microsoft.public.word.newusers
Sesquipedalian Sam
external usenet poster
 
Posts: 131
Default Anyway to get just the path without the filename?

On Sat, 14 Nov 2009 09:45:13 +0200, "Graham Mayor"
wrote:


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


Thank you very much.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:23 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.