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.

Re: wdDialogFileOpen folder problem by Jonathan

Jonathan
Fri Jul 29 12:20:48 CDT 2005

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.


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.
>
>

Re: wdDialogFileOpen folder problem by Jonathan

Jonathan
Sun Jul 31 06:30:04 CDT 2005


"Richard Stone" <RichardStone@discussions.microsoft.com> wrote in message
news:C3CF04B1-1816-4D67-8ED4-20490065448C@microsoft.com...
> 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


Re: wdDialogFileOpen folder problem by RichardStone

RichardStone
Mon Aug 01 02:36:02 CDT 2005

Jonathan

Many thanks, that's looking much better.

Richard

"Jonathan West" wrote:

>
> "Richard Stone" <RichardStone@discussions.microsoft.com> wrote in message
> news:C3CF04B1-1816-4D67-8ED4-20490065448C@microsoft.com...
> > 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
>
>