Browse windows to select item
Forums
Hi Brain,
How are you doing? can you help me with a bit of script? I'm trying to get browse window to select a file. I already found a bit of script that lets you select a folder, but i need to select the file. I'm having problems converting the script to let me select a file instead of a folder.
Function BrowseFolder() Dim oFolder, oFolderItem Dim oPath, oShell, strPath, item Dim msg As String
Set oShell = CreateObject( "Shell.Application" ) Set oFolder = oShell.Namespace(17) Set oFolderItem = oFolder.Self strPath = oFolderItem.Path
msg = "Select file " Set oFolder = oShell.BrowseForFolder(0, msg, 1, strPath )
If oFolder Is Nothing Then BrowseFolder = "" Exit Function End If
Set oFolderItem = oFolder.Self oPath = oFolderItem.Path
BrowseFolder = oPathEnd Function
Thanks again,
Dino.
Hi Brain, I'm trying to
Hi Brain, I'm trying to select a file for example on my desktop. It is a .XAF file (xml auditfile). IDEA has a plugin for it but not for the newest type (3.2).
Do you also have some nowhow for working with xml files and the way to code the tags (XRDF file)?
Thanks again.
Hi Dino, here is some code to
Hi Dino, here is some code to select your file. Sorry, I have never really used xml files so I can't help you. If you have a maintenance contract with IDEA you should probably send them the queation as they can probalby help you.
Sub Main
' Declare variables and objects.
Dim filename As String
Dim obj As Object
' Access the CommomDialogs object.
Set obj = Client.CommonDialogs
' Show the Open dialog box with the applied filters.
filename = obj.FileOpen("","","XML Files (*.XML)|*.XML|All Files (*.*)|*.*||;")
' Display the selected file name.
MsgBox filename
Set obj = Nothing
End Sub
Yes it is, the second
Yes it is, the second parameter allows you to say where you want the folder to open. I have adapted the code above to open in the current project folder under the Source Files folder.
Sub Main
' Declare variables and objects.
Dim filename As String
Dim obj As Object
' Access the CommomDialogs object.
Set obj = Client.CommonDialogs
' Show the Open dialog box with the applied filters.
workfolder = Client.WorkingDirectory()
filename = obj.FileOpen("",workfolder & "Source Files.ILB\*.*","XML Files (*.XML)|*.XML|All Files (*.*)|*.*||;")
' Display the selected file name.
MsgBox filename
Set obj = Nothing
End Sub
Hi Dino, are you trying to
Hi Dino, are you trying to select any file or an IDEA file?
What you are using only selects a folder but there are a few options to select a file or a special function to select an IDEA file, let me know which nd I will give you some examle code.
Brian