Share via

Application.Dialogs(wdDialogFileOpen) Problem

Anonymous
2011-11-11T23:46:03+00:00

I want to display all of the contents of a designated folder (e.g., "N:\archive\Smith") so that I can select one document to open.

After I assign the desired path (e.g., "N:\archive\Smith" or "N:\archive\Smith\*.*") to TheTempPath, here is my code:

With Application.Dialogs(wdDialogFileOpen)

.Name = TheTempPath

.Show

End With

I have tried all sorts of combinations to TheTempPath, with and without the "/" and the "*.*", and with and without quote marks around the variable, and it always goes straight to default directory.  I have also tried .Display instead of .Show and that doesn't work either.  I have checked and double checked that TheTempPath is correct (i.e., such a path exists) and it is correct.

I have used Application.Dialogs(wdDialogFileOpen) in other places and it works fine.  I am totally lost: why could this be happening?

TIA.

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2011-11-12T03:49:47+00:00

    I had tried that combination.  It doesn't  fix the problem.

    Was this answer helpful?

    0 comments No comments
  2. Jay Freedman 207.7K Reputation points Volunteer Moderator
    2011-11-12T01:55:47+00:00

    It's probably the one combination you didn't try yet: keep the backslash after the last folder name in the path, but no asterisks. In your example, use

       TheTempPath = "N:\archive\Smith"

    Any other combination will go to the default directory or, after you've manually chosen some other folder, it will go to that last used folder.

    Was this answer helpful?

    0 comments No comments