
W2000 - change initial focus of the file insert dialog box
John,
I assume you're using this to open the box:
Dialogs(wdDialogInsertFile).Show
If so, what you probably need is the inelegant-but-useful SendKeys
statement, to feed two Shift+Tab's into the dialog. You'd think this
would work:
SendKeys "+{tab 2}"
Dialogs(wdDialogInsertFile).Show
But it doesn't. VBA is too quick to receive the keystrokes. Instead,
separate these into two macros and have one call the other with a tiny
delay:
Sub InsertFileCustom1
Application.OnTime When:=Now + TimeValue("00:00:01"), _
Name:="InsertFileCustom2"
End Sub
Sub InsertFileCustom2
DoEvents
SendKeys "+{tab 2}"
Dialogs(wdDialogInsertFile).Show
End Sub
In future when asking questions about your code, please post the relevant
section of it so we know what to tell you. (Don't shovel the whole macro
into a post; distill it to the part you know has a problem.)
-- See the MVP FAQ at http://www.mvps.org/word --------------------------
----------------- "Life is nothing if you're not obsessed." --John Waters
-------------------------------------------------------------------------
Please reply only to the newsgroup. Note: MVPs do not work for Microsoft.
Quote:
> With a routine I'm automatically opening the file insert dialog box.
> However the initial focus is standard on the 'file name' text box.
> How can make my routine so that when the file insert dialog box is opened
> the focus is not on the standard text box anymore but on the window that
> lists all the file names so that I don't have to click or tab to the file
> window.
> Thanks,
> John