Macro for Insert.File show all files

  • Thread starter Thread starter Lawrence Gould
  • Start date Start date
L

Lawrence Gould

Dear All,

In MS Word 97, is there a way to set up Insert|File so it
defaults to All Files instead of to Word Documents?

The following macro, which works for my install of Word, shows
All Files for File|Open, but when I try creating another macro by
replacing FileOpen with InsertFile, that new macro doesn't work for
File|Insert :

Sub FileOpenShowAllFiles()
Dim dlg As FileOpen
GetCurValues dlg
dlg.AddToMru = 1
dlg.Name = "*.*"
If Dialog(dlg) Then FileOpen dlg
End Sub

From six years ago, "rich" on this newsgroup recommended the
following macro for Insert|File, but it doesn't work on my computer:

Sub MAIN()
Dim dlg As InsertFile
GetCurValues dlg
dlg.Name = "*.*"
Dialog dlg
InsertFile dlg
End Sub

I've played with this second macro, but, alas, I don't know VB.

Btw, is there an advantage to name these macros (including the
File|Open macro) "Sub MAIN()"? And can I have two macros with the same
name?

Thanks for your help.

Virtually,
Larry
 
Larry,

Try:

Sub InsertFile()
SendKeys "%t{Home}{Enter}"
Dialogs(wdDialogInsertFile).Show
End Sub
 
Back
Top