Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy ChangeFileOpenDirectory quits working more often than not (Word 2003)

    I'll admit I use Word in ways that it probably wasn't intended (my wife cringes when I describe certain things). I'm a big believer in "Work Smarter Not Harder" so I've macroed a lot of things. For instance, I've macroed and toolbar-buttoned a lot of commands I frequently use, like changing my (at that time) default file-open directory.

    For instance, in order to make the directory named 'Fourth" located at C:\First\Second\Third, the current default directory, I've a macro with the command: ChangeFileOpenDirectory "C:\First\Second\Third\Fourth\".

    However, more often than not when I execute that macro (or any of the others of similar nature) and then select File-Open, the directory I'm presented with is the My Documents directory . . . which isn't even my default file location!

    All I want to be able to do is have a macro-assigned toolbar button that enables me to click the button so that, when I subsequently select File-Open, the directory specified in the macro is the one that appears.

    Am I doing something wrong?

    ~Masterius
    Last edited by Masterius; 2012-08-28 at 16:25.

  2. #2
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    That setting only "sticks" for the current Word session, and the FileOpen path changes if/when you open a document from another folder.

  3. #3
    New Lounger
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I understand, and expect, that. However, suppose I have a macro called "Directory", and the command within the macro is ChangeFileOpenDirectory "C:\First\Second\Third\Fourth\". When I execute the macro "Directory" and then immediately select File-Open, the directory being opened should be C:\First\Second\Third\Fourth\. 19 times out of 20 it's not; instead, it's opening "My Documents".

  4. #4
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    Willow Grove, Pennsylvania, USA
    Posts
    205
    Thanks
    4
    Thanked 49 Times in 40 Posts
    Google turns up at least a half dozen distinct threads going back to 2005 or so (plus the usual echos from all over UseNet) talking about exactly this bug. As far as I could tell, none of them came up with a real answer. My copy of Word 2003 does the same thing -- I have yet to see ChangeFileOpenDirectory work correctly. It does work properly in Word 2007 and later.

    What will work is to override the FileOpen command with a macro of the same name that includes code like this:

    Sub FileOpen()
    With Dialogs(wdDialogFileOpen)
    .Name = "C:\First\Second\Third\Fourth\"
    .Show
    End With
    End Sub

Posting Permissions

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