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?
0
Sesquipedalian
11/13/2009 3:56:46 PM
word.newusers 801 articles. 0 followers. Follow

5 Replies
641 Views

Similar Articles

[PageSpeed] 33

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" <sesquipod@nowhere.noway> wrote in message 
news:k90rf51060na28tgrfbnk0drq5nrfk93ul@4ax.com...
>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? 


0
JoAnn
11/13/2009 4:13:10 PM
On Fri, 13 Nov 2009 11:13:10 -0500, "JoAnn Paules"
<jl_paules@hotNOSPAMmail.com> 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.
0
Sesquipedalian
11/13/2009 4:22:15 PM
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" <sesquipod@nowhere.noway> wrote in message 
news:k90rf51060na28tgrfbnk0drq5nrfk93ul@4ax.com...
> 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? 

0
Terry
11/13/2009 5:20:30 PM
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? 


0
Graham
11/14/2009 7:45:13 AM
On Sat, 14 Nov 2009 09:45:13 +0200, "Graham Mayor"
<gmayor@REMOVETHISmvps.org> 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.
0
Sesquipedalian
11/14/2009 2:13:28 PM
Reply:

Similar Artilces:

Unable to Get Statements
I am able to get statements on one windows xp screen name but not on the other. The working screen name works great asking which account to download to and everything, the other looks like its downloading but never imports the information. I have reinstalled ...

how to get more than 256 colomns in excel sheet ?
I am working in a project needs more than 256 colomns in Excel. How to do that? You can't. Use another sheet or change to rows. -- Don Guillett SalesAid Software donaldb@281.com "sheshtar5212" <sheshtar5212@discussions.microsoft.com> wrote in message news:87D99E42-8A69-40D8-BC74-7FF7297FEB5D@microsoft.com... > I am working in a project needs more than 256 colomns in Excel. How to do that? Excel does not support more than 256 columns on one worksheet. Change your layout or use another application like Quattro Pro. Gord Dibben Excel MVP On Tue, 19 Apr 2005 05:47:...

How to get rid of unwanted "sets" of Personal Folders
Hi, I'm a fairly casual user of Outlook--no Exchange Server or anything, but I occasionally run across the problem of getting multiple "sets" or instances of "Outlook Today--Personal Folders" in the same installation. This usually occurs after moving a .pst file from one location to another, or, as happened recently, when someone else installed a 2nd copy of Office on a computer that already had Outlook running... actually I'm a little unclear as to why it happened, but I would like to get rid of the duplicate set. In case I'm not being clear, when o...

how to get Word Art along a circular arc?
I'm designing a logo for our company conference. I'd like the main shape of the logo to be a circle, with the theme of our annual conference across the top of the circle. Then I'd like to have 3 big rings going around and disappearing behind the circle (rather like the rings of Saturn). I have 2 questions. 1) I'd like the text to be in an arc that parallels the outline of the circle - the text will take up about one quarter of the circumference. I've discovered how to get Word Art to put the text in an arc, but the arc is oval rather than circular, and doesn'...

Not getting HDN_BEGINTRACK ?
Hi: Anyone knows if there some trick to process HDN_BEGINTRACK or HDN_TRACK message? I have mapped the message with corresponding handler but the handler function never got called. Thanks for any input. Polaris ...

Is it easier to do math in excel, or just use a calculator?
I have a lot of sums I have to add up, and was advised by my boss that it would be best to use Excel to do it; however, i'm having a hard time figuring out how to add all these numbers together using excel. I tried the tutorial and it's not really giving much info. Which is most convenient to use, Excel, or a calculator? And if it's Excel, then how do you get it to do the math? Any help appreciated thanks. -- Steveclark Hi, Excel is more convenient, look into this web it will help http://spreadsheets.about.com/od/excel101/a/Excel_beg_guide.htm In the abov...

Why am I getting this?
Hi guys When someone in my contact list send me an e-mail, he or she gets the following message: "This report relates to a message you sent with the following header fields: Message-id: <EEC70F370C2A4D20AF5EEE5D60269946@HomePC> Date: Thu, 25 Feb 2010 11:07:16 -0330 From: OldSaltyFrog <oldsaltyfrog@eastlink.ca> To: Gill Julien <gilljulien@eastlink.ca>, OldSaltyFrog <oldsaltyfrog@eastlink.ca> Subject: test Your message cannot be delivered to the following recipients: Recipient address: mr.david_wilson@yahoo.com.hk Original address: gil...

I am new: getting cross stead of picture on Website
I am a starter: I designed a test start web with Publisher2003 and I get upon publishingthe website via FTP the website with the right text ,but further squares ,with a "cross"where a picture should be. If I work in Publisher/Explorer and do a "VIEW" then it is WITH the pictures. What is wrong. ?? William A common mistake is to fail to upload the subfolder that contains the images. Upload the sub-folder with the home page. -- David Bartosik - MSFT MVP For Publisher help visit: www.davidbartosik.com Enter to win Pub 2003: www.davidbartosik.com/giveaway.aspx "P...

How would I go about getting these results?
source: ContactID ProjectID RoleID 1 1 1 1 2 2 1 3 1 2 1 1 2 2 2 How would I return the results where the noly record to show would be the 3rd one where there is no one with the RoleID of 2. Stated differently, how do I exclude all records where there is someone with a RoleID = 1 AND 2 and return only records that have ONLY someone with RoleID = 1 I hope this makes sense. Thanks. I am missing something. Why is row 3 returned as Con...

How do I get text to permanently flash?
Excel 2000. Need text to flash at all times for a display screen. Has to be excel as several calculations also required Don't do it. People will hate you for it. -- HTH RP "garym" <garym@discussions.microsoft.com> wrote in message news:8D1EDD3E-14DD-42E6-A703-12291DE3B377@microsoft.com... > Excel 2000. Need text to flash at all times for a display screen. Has to be > excel as several calculations also required I owuld love to know this to... the only thing I can think of is som kind of loop in VB that deletes and reenters teh text over and over.. I know...

Getting a average value without including zeros
Hello, This is kind of complicated so I will try to explain this the best I can. Lets say I have a bunch of numbers with zero's in columns c2,d2,e2 and this has 407 rows. (Maybe this is the correct way of saying it =sheet2!c$2:$e$407) From this I would like that it calculates the average for me but I don't want the zeros to be included in the average just all the other numbers. (See example below) test test1 test2 test3 test4 Avg. 2/12/04 0 2/12/04 5 2/12/04 100 2/12/04 ...

Am not getting "send" option to email Excel sheet
I am attempting to email an Excel sheet. My textbook shows that a "send this sheet" box should appear. I do not have that. I have MSN Hotmail for email. Could this be making this difference? I have also experienced difficulty in emailing Word documents. Can you help? ...

How do I get back a lost Staus Bar
I find myself unable to move from page 2 to 3, 4 to 5, etc in my 8 page document in Publisher In addition, seem to have lost my cut and paste functions in Publisher Try: View | Status Bar Cut/Paste...dunno...try clearing your temp files. "Grandma" <Grandma@discussions.microsoft.com> wrote in message news:507AC2D9-AD40-4F5D-98C5-4997C8775EBA@microsoft.com... |I find myself unable to move from page 2 to 3, 4 to 5, etc in my 8 page | document in Publisher | | In addition, seem to have lost my cut and paste functions in Publisher ...

Is there anyway to simplify the Deployment process?
Hello, I am looking for any best practices that will aid in deplyment of my application. My application has one SQL 2008 database. When I make changes and update/upgrade the schema, I need to track the changes and prepare a script to deliver to each of my Clients. They run the script and everything is wonderful again. However, the issue I have been facing is that different Users are at different levels of patches applied. So, for instance, User 1 may be running a version from last December, while User 2 is running a version from last Tuesday. When patches to the schema/stored pr...

GET WINDOW PROPERTIES FROM HANDLE
how can i get alll the properties of a window( not created by a user application) from the Window Handle? regards, kedar. >how can i get alll the properties of a window( not created by a user >application) from the Window Handle? Which "properties" are you looking for? Dave "David Lowndes" wrote: > >how can i get alll the properties of a window( not created by a user > >application) from the Window Handle? > > Which "properties" are you looking for? > > Dave > thank you for tour immediate response... i want t...

Print Just One Record
Hi, I have a report which is based on a query, which filters out only one record. I want to print only that one record at a time, without the printer going to the next page. How do I do that Thanks Ange If your query returns only one record, then the report based on the query should only return one record. -- Duane Hookom Microsoft Access MVP "Ange Kappas" wrote: > Hi, > I have a report which is based on a query, which filters out > only one record. > I want to print only that one record at a time, without the printer going to > ...

trying to create a totals sheet that will get data from one or many sheets
I have a work book that I use for a time sheet. It contains four worksheets 1) "blank time card" 2) "employees 3) "job numbers" 4) "totals" What I am trying to do is take the value from range "b8 to b31" ( the job numbers) and it's corresponding total times from "q8 to q31"&"r8 to r31" from ANY worksheet other than the ones named above (1-4) and put the data on sheet "totals". Now for the kicker... sheet "me" may contain one or more job numbers, and the next sheet "you" may not have the s...

MAcro
This is the macro to stop sending without a subject as well as to warn the user whn he sends to the distribution list that starts with "#" However this code detects the email addresses in TO / CC as one single string. For eg if i have shreekanth Murali; #IN - distribution then it detects "shreekanth murali; #in - distribution" and not warning the presence of a distributon list in TO field... Im a beginner please lemme know how can i do it Private Sub Application_ItemSend(ByVal item As Object, Cancel As Boolean) Dim strSubject As String strSubject...

Getting List of Visible Windows
Hi All, I am working on a problem that requires me to know whether or not any part of a particular window is visible (even if it's like a one pixel corner). In my misunderstanding, I thought that ::IsWindowVisible would cover it, but it looks like that call just verifies that the hWnd actually has a dialog box. I was able to take it a step further and find out whether or not a window is minimized using ::GetWindowPlacement, but I really need to find out if a window is visible or not (in other words, not completely covered by higher z-order windows). Is there some sort of API call that ...

Anyway to transfer Money to a new computer?
I purchased and downloaded Money 2007 Home and Business some time ago. I now have a new laptop, and have learned that I can no longer download the product (time has passed). My old system is still operational -- is there any way for me to transfer the application? Does Microsoft expect us to re-purchase with each new system? (lame) "kjcb" <kjcb@discussions.microsoft.com> wrote in message news:61FB8109-5199-467D-A7DB-A971FCB5F671@microsoft.com... >I purchased and downloaded Money 2007 Home and Business some time ago. I >now > have a new laptop, and have learned...

Veritas 9.1 restore without Agent
Hello, I do not have the Veritas Exchange Backup Agent module nor the Advanced Open File option installed on my domain (2 DCs / AD / Win2K). I was wondering if I can still do a full restore of Exchange 2000 in case of a full disaster recovery (clean install of MS Small Business Server 2K)? Please explain any limitations. Thank you in advance, Rocky You can't do an online backup of Exchange with Veritas unless you have the agent....get the agent. Re the open file agent - a lot of opinions on that one. However, even if you get and use it, you shouldn't try to use it to back up Exc...

Get at messages in queue
Is it possible to get at the undeliverable messages that are held in a queue (eg to check the message body or redirect undeliverable messages). I would like to be able to selectively forward them to an alternate email address or to archive them to a PST etc rather than just deleting them? Thanks Alan ...

Get handle of monitor fails
I use HMONITOR hMon = MonitorFromWindow(GetParent()->m_hWnd,MONITOR_DEFAULTTONEAREST); to get the handle for the second monitor. This however fails because GetParent()->m_hWnd is not found. What is going wrong ? Matthias On Wed, 18 Apr 2007 14:08:23 +0200, Matthias Pospiech <matthias79@gmx.de> wrote: >HMONITOR hMon = >MonitorFromWindow(GetParent()->m_hWnd,MONITOR_DEFAULTTONEAREST); >This however fails because > >GetParent()->m_hWnd > >is not found. What do you mean by "not found"? Is m_hWnd NULL? Or are you having a compiler error? M...

How do I get the budget part of Microsoft Money to work?
I'm trying to work with my budget in Microsoft Money and am running into all sorts of problems. 1) I have multiple accounts set up in Money but I want ONLY ONE account to be reflected in the budget. I have gone to every category's page and have selected my cash flow be for that one account and yet it continues to show other transactions from my other accounts in my budget. How do I get to do only one? 2) It doesn't seem to reflect accurate information when I look at a report. For example, I have a category I budgeted 70 dollars in. My report says I've only spent 91 cent...

Getting User Name
I am trying to capture user ID ! I have seen various ways how, but I can't seem to capture the unique ID. I have a SQL Server 2k (back end for this DB). The SQL database is running with user permissions for our ERP software. In this new DB the permission are applied to the only three users who will have access to this DB through an ODBC but I want to collect the user ID if possible. I do not have DB security set up in Access since permissions can be carried from SQL Server. Any ideas? Thanks, Rohn "Rohn Everson" <iowarohn@msn.com> wrote in message news:Ob...