Use the following code to show the standard windows open dialog box:
Set objOpenDlg = DotNetFactory.CreateInstance("System.Windows.Forms.OpenFileDialog", "System.Windows.Forms")
objOpenDlg.InitialDirectory="c:\\"
objOpenDlg.Filter="All files (*.*) |*.*"
objOpenDlg.RestoreDirectory=true
objOpenDlg.FilterIndex=2
objOpenDlg.ShowDialog()
Msgbox objOpenDlg.FileName
The OpenFileDialog methods and properties can be found here
Not necessary to have .NET Add-in selected to use this class.
Set objOpenDlg = DotNetFactory.CreateInstance("System.Windows.Forms.OpenFileDialog", "System.Windows.Forms")
objOpenDlg.InitialDirectory="c:\\"
objOpenDlg.Filter="All files (*.*) |*.*"
objOpenDlg.RestoreDirectory=true
objOpenDlg.FilterIndex=2
objOpenDlg.ShowDialog()
Msgbox objOpenDlg.FileName
The OpenFileDialog methods and properties can be found here
Not necessary to have .NET Add-in selected to use this class.
No comments:
Post a Comment