>I am using Word 2003 and would like to create a macro that goes to File,
>Open and navigates to a certain folder. Once it gets to that folder, the
[quoted text clipped - 3 lines]
>
>Ricki
You're thinking in terms of what you would do if you were operating
Word with the keyboard and mouse. VBA doesn't work that way.
The VBA way is to create an object that represents the dialog, then
set its properties so it will do what you want, and finally start it
running. In this case, the property of interest is called .Name, and
it represents the contents of the Filename box in the dialog. If you
set that property to the complete folder path and end it with a
backslash instead of a filename, the dialog will immediately open with
that folder visible:
Sub demo()
Dim dlg As Dialog
Set dlg = Dialogs(wdDialogFileOpen)
With dlg
.Name = "C:\Some folder\Some subfolder\"
.Show
End With
End Sub
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Ricki Miles - 28 Jun 2007 01:36 GMT
Thanks for your help, Jay - it works perfectly now,
Ricki
>>I am using Word 2003 and would like to create a macro that goes to File,
>>Open and navigates to a certain folder. Once it gets to that folder, the
[quoted text clipped - 32 lines]
> Email cannot be acknowledged; please post all follow-ups to the
> newsgroup so all may benefit.