Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Br. Columbia, Canada
    Posts
    109
    Thanks
    1
    Thanked 0 Times in 0 Posts

    drive letter + file name ((XP Office 2k))

    I frequently find that I have several files open. Each with the same file name but opened from different drives. A: C: D: (cd backup) G: (usb 4 home 2 office transfer). It's really quite easy to overwrite a more recent file with an old one by accident.

    Is there any way to make Office include the drive letter the file was opened from as well as the file name and programme?
    Knowing this would save me a lot of clicking around when saving as well as confirming I am working on the 'master' file.
    Thanx, Joan

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: drive letter + file name ((XP Office 2k))

    That's really a Windows question rather than Office if I understand you correctly. But include the drive letter where? Are you talking about the buttons on the task bar, the icons you see when you hit Alt+Tab, the title bar for the window or what?
    Charlotte

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: drive letter + file name ((XP Office 2k))

    You could do what a lot of document management software products do, and update the window title bar every time you open a file (from inside the application) or save. The code to do this in Word is a piece of cake, but it's harder in other applications because they don't have automatic command substitution.

    So in Word, you could create some new macros similar in concept to this one:

    <pre>Sub FileOpen()
    ' Show File > Open dialog and, if a file is opened, change the
    ' title bar to show the full path
    With Dialogs(wdDialogFileOpen)
    If .Show = -1 Then
    ActiveDocument.ActiveWindow.Caption = ActiveDocument.FullName
    End If
    End With
    End Sub</pre>

    I've attached a complete set in a Word document. Hope this helps.
    Attached Files Attached Files

  4. #4
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Br. Columbia, Canada
    Posts
    109
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: drive letter + file name ((XP Office 2k))

    Thank you J.Scher for your response. Your attachment I think will be helpful just as soon as I hit the "how to macro" books. Right now it is a very fuzzy area for me. And Visual Basic is a total dark hole. Are there any good tutorial sites on the web for someone like me?
    Thanx again, Joan

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: drive letter + file name ((XP Office 2k))

    Well, let's see... You could start with some online documentation:

    Creating a macro with no programming experience using the recorder (Word MVP FAQ Site)

    Getting to grips with VBA basics in 15 minutes (Word MVP FAQ Site)

    Use Macros to Automate Repetitive Tasks in Microsoft Word (Microsoft Developer Network)

    Overriding the Built-In Menus and Commands in Microsoft Word (Microsoft Developer Network)

    Microsoft Office 2000/Visual Basic Programmer's Guide (Microsoft Developer Network)

    I'm sure there are many more, and you can find book suggestions on the Books board, as well as this one. Mostly, though, you have to study and experiment with other peoples' code, try out small projects, make mistakes, crash windows and get up and reboot again. Then, in a couple of years, Microsoft will change it all again. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

  6. #6
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Br. Columbia, Canada
    Posts
    109
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: drive letter + file name ((XP Office 2k))

    Thank you for the pointers. I can see that I'll have to put on my student cap for all this. Don't like the comment about crashing though. Keep your fingers crossed for me....
    And Happy Valentine's Day
    Joan

  7. #7
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Br. Columbia, Canada
    Posts
    109
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: drive letter + file name ((XP Office 2k))

    A perfect solution !! Works like a hot darn. Thank you so much for your suggestion and so simple too!
    I'll be using it on all my doc & xls files in the future, not just the ones I move around a lot.
    Thanx again.
    Joan

  8. #8
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: drive letter + file name ((XP Office 2k))

    Hi Joan,

    In Word, you can get the current file's name and path to show (eg in a header or footer, by inserting a field (Ctrl-F9) into the header or footer with the following text:
    FILENAME p
    so it looks like {FILENAME p} (ie, you don't type the braces - you use Ctrl-F9 to create them and do your typing in between).
    If you format this text as hidden, it won't print, but you'll still be able to see it on-screen unless you tell Word to hide hidden text.

    In Excel, you can get something similar by putting the following formula into any cell:
    =CELL("filename")
    Note that, besides returning the filename and path, this causes excel to display the worksheet's name too.
    Alternatively, you could use:
    =INFO("directory") to get just the current DEFAULT path for the excel "session". This can change during a session depending on where you opened the last file from or where you saved a file to.
    You can stop the above formulae results from printing out by putting them outside your print area.

    Hope this helps.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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