I managed to launch a search (via VBA) on an EPDM vault via the snippet of code below.
My question is the following, I would like to retrieve in this search, the variables of each search results, I have, for example, a variable called _NumNDL.
I guess you have to use something like GetVar or eNumVar on one of the results, but I don't have the syntax or the solution. If anyone knows how to help me?
Sub FindFile()
Dim eVault As IEdmVault5 Dim eSearch As IEdmSearch5 Dim eResult As IEdmSearchResult5 Dim FileCount As Long
FileCount = 0
'Connection to the trunk Set eVault = New EdmVault5 eVault.LoginAuto eVault.GetVaultNameFromPath("C:\_Clarity\"), 0
'Launch of the research Set eSearch = eVault.CreateSearch eSearch.AddVariable "_NDLNouv", "%1%" eSearch.Filename = "%NDL%" Set eResult = eSearch.GetFirstResult
Reading the results While not eResult is nothing FileCount = FileCount + 1
Thank you for your answer, but you give me a code that I wrote myself in response...
Sorry to contradict you, I may have expressed myself badly, but there are ePDM variables, if you look in the code I provided, I add the variable "_NDLnouv" to my search.
Via eResult, I can't retrieve all the search fields:
I would like to be able to retrieve all the fields related to the search result.
Unless I'm mistaken, (I've already done this kind of macro), you have to extract the file to retrieve the content of the variable and then cancel the extraction.
Indeed, I missed it too, I could have checked it myself, in any case, it works niquel thank you very much.
However, in the state of mind, I find it strange that we are forced to go and extract the file because in the search display we can clearly see the different variables displayed and which are part of the search result. I'm surprised that you can't read them without going through lock or unlock.
It's indeed strange, but from what I understood from the API help, it's related to the fact that variables are viewable via maps when they are editable. In fact, the files must be extracted.