D
Dan Williams
People have already complained about Word 2003's intermittent failure
of
ChangeFileOpenDirectory "H:\MISC\SpecialDirectory\"
Dialogs(wdDialogFileOpen).Show
when they're trying to initiate the File Open dialog box with a VBA-
specified directory. The response has been that they should use this:
With Dialogs(wdDialogFileOpen)
.Name = "H:\MISC\SpecialDirectory\*.doc"
.Show
End With
However, I gave up on .Show long ago, because after you choose a file,
it fails to add it to the File menu's recently used file list. In
Word 2000, I settled for this distasteful substitute*:
ChangeFileOpenDirectory "H:\MISC\SpecialDirectory\*.doc"
SendKeys "%f" ' ALT+f
SendKeys "o"
This works in Word 2000.
Now, in Word 2003, this fails a lot of the time, bringing you to My
Documents instead. (It sometimes fails for a long time, and it
sometimes works for a long time during which I can't get it to fail,
so please don't just reply it that works OK for you.)
Is there any way to get this to always work, including putting the
file in the recently used file list?
It's such a simple thing to want to do. I know there's an
AddToRecentFiles variable in the Dcoument.Open method, but please
don't say I need to duplicate the whole FileOpen mechanism (as
with .GetOpenFilename in Excel).
Dan Williams
danwPlanet
*Note that I had to use two SendKeys statements, because when you use
SendKeys "^o" ' (Ctrl+o), it inexplicably puts you into Outline View
instead of doing what Ctrl+o is supposed to do.
of
ChangeFileOpenDirectory "H:\MISC\SpecialDirectory\"
Dialogs(wdDialogFileOpen).Show
when they're trying to initiate the File Open dialog box with a VBA-
specified directory. The response has been that they should use this:
With Dialogs(wdDialogFileOpen)
.Name = "H:\MISC\SpecialDirectory\*.doc"
.Show
End With
However, I gave up on .Show long ago, because after you choose a file,
it fails to add it to the File menu's recently used file list. In
Word 2000, I settled for this distasteful substitute*:
ChangeFileOpenDirectory "H:\MISC\SpecialDirectory\*.doc"
SendKeys "%f" ' ALT+f
SendKeys "o"
This works in Word 2000.
Now, in Word 2003, this fails a lot of the time, bringing you to My
Documents instead. (It sometimes fails for a long time, and it
sometimes works for a long time during which I can't get it to fail,
so please don't just reply it that works OK for you.)
Is there any way to get this to always work, including putting the
file in the recently used file list?
It's such a simple thing to want to do. I know there's an
AddToRecentFiles variable in the Dcoument.Open method, but please
don't say I need to duplicate the whole FileOpen mechanism (as
with .GetOpenFilename in Excel).
Dan Williams
danwPlanet
*Note that I had to use two SendKeys statements, because when you use
SendKeys "^o" ' (Ctrl+o), it inexplicably puts you into Outline View
instead of doing what Ctrl+o is supposed to do.