Re: wdDialogFileOpen folder problem by RichardStone
RichardStone
Sun Jul 31 05:08:03 CDT 2005
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
"Jonathan West" wrote:
> Hi Richard
>
> Try this instead
>
> With Dialogs(wdDialogFileOpen)
> .Name = UserDir
> .Show
> End With
>
> --
> 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
>
>
> "Richard Stone" <Richard Stone@discussions.microsoft.com> wrote in message
> news:66FCCA91-8849-4D76-A59F-2A501EAF2AAA@microsoft.com...
> > 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.
>
>