Results 1 to 7 of 7
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Posts
    1,418
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Inserting filename and path (but not extension)

    How do I add/insert the filename & path, but not the extension, in a header/footer (Word 2000, Version 9.0)?

  2. #2
    5 Star Lounger
    Join Date
    Dec 2000
    Location
    Tallahassee, Florida, USA
    Posts
    901
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inserting filename and path (but not extension)

    You didn't mention your version, but nonetheless your options are limited. Using AutoText you can insert the filename (with extension) or filename and path (which includes the p switch in the field). You can {DOCPROPERTY "Title"} which will give you the information included in the title field of the document property dialog (File / Properties) which is generally the document name without extension or can be altered to your own specifications. However, to my knowledge, there's no field property for path alone.

    <font color=red>Note: the curved braces are created using Ctrl+F9 and you can copy/paste what's enclosed in your document.</font color=red>
    Karen

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Inserting filename and path (but not extension)

    If you are prepared to use VBA the following should insert the file name, at the current cursor position, in the manner you wish for. However, if the document

  4. #4
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inserting filename and path (but not extension)

    Charles,

    Woody might consider that dangerous. Then you mightv not see and "exe" or "vbs" on an attachment to an Outlook messages.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  5. #5
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inserting filename and path (but not extension)

    Andrew,


    <img src=/S/lightbulb.gif border=0 alt=lightbulb width=15 height=15>Can you, or any other VBA mega brain out there, do anything with this off the wall idea?

    On screen you can select *part* of a field and format the font to hidden or colour it white and it disappears. Trouble is as soon as the field updates it reappears.

    Can you lock *just* the formatting so that the dynamic update of the field is retained but the extension is not visible because these four characters are hidden/coloured white?

    stuck (but not for lack of ideas)

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Inserting filename and path (but not extension)

    Stuck,

    When a field is updated, the existing text is removed, and as the formatting you refer to is part of the text and not the paragraph, it is lost with the text. Any way, if you are going to use VBA to restore the formatting, you might as well use it to compose the text you want in place.

    Unfortunately Word does not seem to have as many trappable events as Excel, and so is difficult to update automatically via VBA.

    So I don't think you can lock formatting applied to text via VBA.

    Andrew C

  7. #7
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,048
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Inserting filename and path (but not extension)

    The only easy way I know to do this is to turn display of extensions for known file types off in Windows. From any Explorer window...

    View => Folder Options => Views (tab)

    This is probably not a good idea, both for the reasons that Geoff points out, but also because those extensions carry important information when you are trying to figure out what is going on. They are, for Windows, what the paragraph marks are in Word.
    Charles Kyle Kenyon
    Madison, Wisconsin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •