The following code works great for WinXP, and it's been what I was using to present the user an Open File dialog window.
But, moving to Windows Server 2003 prevents me from being able to use that object. I was able to find this Open File dialog window, but it's not very useful because I can't filter or set the directory.
Similarly, I know it's possible with an .htm file to have a browse button with a starting directory (this doesn't seem to work in HTA however)... The problem I have here, is that I don't know if/how to apply a filter. Is it possible?
What I'm hoping for is someone knows another option that I've missed or how to make what I have work. If nothing else, I can code my own open file dialog box.
Thanks
Code:
Set oDialog = CreateObject("UserAccounts.CommonDialog")
oDialog.Filter = "Sessions|*.edp|508 Sessions|*508.edp"
oDialog.InitialDir = "C:\Sessions\"
iResult = oDialog.ShowOpen
If iResult = -1 Then
WScript.Echo oDialog.FileName
End If
Code:
Set oFODlg = CreateObject("SAFRCFileDlg.FileOpen")
iResult = oFODlg.OpenFileOpenDlg
If iResult = 1 Then
WScript.Echo oFODlg.FileName
End If
Code:
<input type="file" name="myFile" value="C:\Sessions\">
Thanks