A
Alfred
Since many years I use the following macro that suits my needs:
Sub FileOpen ( )
SendKeys “+({TAB})”
Dialogs(wdDialogFileOpen).Application.Caption = " "
Dialogs (wdDialogFileOpen). Show
On Error Resume Next
ActiveDocument.ActiveWindow.Caption = _
ActiveDocument.ActiveWindow.Caption +
" "
End Sub
The FileOpen Dialog has one setback, however: it does not allow to
open multiple files at once (error 5174, file cannot be found)
Opening multiple files using a right click also gives an error (there
is another active dialog running)
According to the Microsoft webpages this behavior is by default.
I found two work-arounds or solutions that I cannot get to work.
The first workaround is :
CommandBars.FindControl(ID:=23, Visible:=False).Execute
instead of:
Dialogs(wdDialogFileOpen)
I tried it, but it gave an error.
The second one is (from Microsoft):
This example displays the Open dialog box and allows a user to select
multiple files to open.
Sub ShowFileDialog()
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog( _
FileDialogType:=msoFileDialogOpen)
With dlgOpen
.AllowMultiSelect = True
.Show
End With
End Sub
I tried this macro, but it gives a VB ‘compiling error’
What I want is to use my original code (without extra message boxes,
toolbars or buttons), but to keep the ability of opening multiple
files at once.
I use Windows XP, Word 2003 and VB6.
Anyone can help?
Thanks,
Alfred
Sub FileOpen ( )
SendKeys “+({TAB})”
Dialogs(wdDialogFileOpen).Application.Caption = " "
Dialogs (wdDialogFileOpen). Show
On Error Resume Next
ActiveDocument.ActiveWindow.Caption = _
ActiveDocument.ActiveWindow.Caption +
" "
End Sub
The FileOpen Dialog has one setback, however: it does not allow to
open multiple files at once (error 5174, file cannot be found)
Opening multiple files using a right click also gives an error (there
is another active dialog running)
According to the Microsoft webpages this behavior is by default.
I found two work-arounds or solutions that I cannot get to work.
The first workaround is :
CommandBars.FindControl(ID:=23, Visible:=False).Execute
instead of:
Dialogs(wdDialogFileOpen)
I tried it, but it gave an error.
The second one is (from Microsoft):
This example displays the Open dialog box and allows a user to select
multiple files to open.
Sub ShowFileDialog()
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog( _
FileDialogType:=msoFileDialogOpen)
With dlgOpen
.AllowMultiSelect = True
.Show
End With
End Sub
I tried this macro, but it gives a VB ‘compiling error’
What I want is to use my original code (without extra message boxes,
toolbars or buttons), but to keep the ability of opening multiple
files at once.
I use Windows XP, Word 2003 and VB6.
Anyone can help?
Thanks,
Alfred