FileOpen - dialogbox . change focus?

  • Thread starter Torstein S. Johnsen
  • Start date
T

Torstein S. Johnsen

I use a macro to chance directory and the show the File Open dialog box.

I want the macro to "focus" on the file-list in the dialog box, and not the
file-name-box. (I'm using a norwegian Word - I'm not sure about using the
correct english words).

I have tried to do this by Send Keys - it doesn't work!

All help is appreciated!

Torstein

This is the part of the macro

ChangefileOpendirectory ("C:\test")
dialogs(wdDialogFileOpen).show
sendkeys "+{TAB}" 'this means SHIFT-TAB I suppose
End
 
P

Peter Hewett

Hi Torstein

I don't think you can do what you want. You can change some of the dialogs
settings programatically but you can't set the focus to a particular control.

The reason the SendKeys doesn't work is that the form is modal and the
SendKeys statement is not executed until you press the dialogs OK or Cancel
button.

HTH + Cheers - Peter
 
J

Jonathan West

Hi Torstein,

Which version of Word are you using? If you are using Word 2002 or later
there may be an alternative approach.
 
T

Torstein S. Johnsen

I use Word 97, but we plan to change to word 2003 or XP. Thus I'm really
interested in the alternative approach.

Torstein
 
P

Perry

application.FileDialog(msoFileDialogOpen)
Is the XP+ version of the FileOpen dialog.

Among other enhancements, the Filter/FilterIndex has become available
to Word developers.
(Filter/FilterIndex was availble in Excel prior to XP in
Application.GetOpenFileName)

As to changing focus to the filelist in this new dialog:
Nope, not possible as well ... :((

Krgrds,
Perry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top