wdDialogFileOpen folder problem

R

Richard Stone

We've just upgraded our system to W2k3 terminal server with Word 2k3 SP1.
Macros which worked fine in Word97 are now a little flaky!

In a couple of places we have code as follows:
ChangeFileOpenDirectory UserDir
Dialogs(wdDialogFileOpen).Show

The Open dialog always appears but sometimes the "look in" folder is "My
Documents" not the directory set in UserDir. The directory in UserDir does
exist - we get an error if it doesn't.

There is no pattern to when the right directory appears, it can work
correctly fifteen times or more and then fail, alternatively it can fail
fifteen times and then work once.
 
R

Richard Stone

Jonathan

Thanks for that, I've tried it but it does not give the desired results. :-(

Your code puts the folder name in the file name box and therefore does not
show the contents of the folder in the listbox that forms the main body of
the dialog. My original code lists the contents of the folder and leaves the
file name box empty.

Let me try to explain further...
We have a network drive that all users access, that has a folder
"precedents". The Precedents folder contains a load more sub-folders, one for
each department. These sub-folders hold a load of Word documents.

We've created a dialog box which contains a list box showing the sub-folders
of precedents, a user clicks on one of these, then clicks the Open button.
This should present the built in open dialog listing the word documents in
the subfolder.

Does this make sense? Any further ideas?

Thanks

Richard
 
J

Jonathan West

Richard Stone said:
Jonathan

Thanks for that, I've tried it but it does not give the desired results.
:-(

Your code puts the folder name in the file name box and therefore does not
show the contents of the folder in the listbox that forms the main body of
the dialog. My original code lists the contents of the folder and leaves
the
file name box empty.

Ah. You need to ensure that UserDir ends with a closing \ character. Then it
will behave right.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top