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.
Dino
Offline
Last seen: 5 years 7 months ago
Joined: 02/08/2018 - 02:45
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
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 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.
Hi Brain,
It works like a charm, Thanks!
We have a support contract so I will try to contact them for some info.
Is it possible for this file window to open to a specific folder, such as the Source Files folder of the current idea project i am working in?
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.
This it possible to write a script that allows the user to script an equation from a folder and insert that equation into a direct extraction
thanks
Hi Pat, I am not sure what you mean by "script an equation from a folder". In the next version of IDEA we should have access to the equation editor through IDEAScript.