Hi
There is no built in FileOpen dialog in this version of VBS, you have to access the CommonDialog DLL in Windows.
The method is well documented, the below does just enough to open a dialog, you will have to research the way to fill the structure properly and read the returned structure when the dialog exits.
It might just be a lot of work for what you are trying to achieve.
Paste the below into a file, saved as a macro in whatever profile you are using, and call it from the MDI line and a FileOpen dialog will appear.
A message will tell you the return value of the dialog.
regards
ArcEye
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' save as m*********.m1s and call from MDI line to test
Public Const OFN_LONGNAMES As Long = &H200000
Public Const OFN_PATHMUSTEXIST As Long = &H800
Public Const OFN_CREATEPROMPT As Long = &H2000
Public Const OFN_NODEREFERENCELINKS As Long = &H100000
Public Type OPENFILENAME
nStructSize As Long
hWndOwner As Long
hInstance As Long
sFilter As String
sCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
sFile As String
nMaxFile As Long
sFileTitle As String
nMaxTitle As Long
sInitialDir As String
sDialogTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
sDefFileExt As String
nCustData As Long
fnHook As Long
sTemplateName As String
End Type
Public OFN As OPENFILENAME
Public Declare Function GetOpenFileName Lib "comdlg32" Alias "GetOpenFileNameA"(pOpenfilename As OPENFILENAME) As Long
Sub Main()
Dim bSuccess As Boolean
bSuccess = false
Message ""
OFN.nStructSize = Len(OFN)
OFN.hWndOwner = hwnd
OFN.sFilter = "*"
OFN.nFilterIndex = 1
OFN.sFile = "" & Space$(256) & vbNullChar & vbNullChar
OFN.nMaxFile = Len(OFN.sFile)
OFN.sDefFileExt = "" & vbNullChar & vbNullChar
OFN.sFileTitle = vbNullChar & Space$(256) & vbNullChar & vbNullChar
OFN.nMaxTitle = Len(OFN.sFileTitle)
OFN.sInitialDir = "" & vbNullChar & vbNullChar
OFN.sDialogTitle = "" & vbNullChar & vbNullChar
OFN.flags = OFN_LONGNAMES Or OFN_CREATEPROMPT Or OFN_NODEREFERENCELINKS Or OFN_PATHMUSTEXIST
bSuccess = GetOpenFileName(OFN)
Message "Dialog return was" & Str(bSuccess)
If bSuccess Then
' do stuff here
End If
End Sub