AnsweredAssumed Answered

Using IEDMSearch7 in VBA

Question asked by Martin Solem on Jun 1, 2018

Hi forum,


What i am trying to accomplish:

I have an Excel spreadsheet containing file names, document numbers, file revision and state.

Based on document number, i need to search vault to locate the file and update Excel with correct revision and state.


The macro is working well, but i thought i'd throw in a check to see if there were more matching documents. The document number *should* be unique, but there are no guarantees, and i would like to be sure my spreadsheet is correct.


I am using this:

     sDocumentNumber = Range("G" & i).value

     search.AddVariable "Document Number", sDocumentNumber

     search.SetToken Edmstok_AllVersions, False


My check is simple, i run a counter on the search result, using GetNextResult.

However, i discovered i got two matches on the same document and the reason is because the value sDocumentNumber was present in two configurations.


It doesnt seem like i can specify which configuration to search for the variable value, i mean it would be pretty sweet to search for:

search.AddVariable "Document Number", sDocumentNumber, <ConfigurationName>


SetToken Edmstok_Configuration <ConfigurationName>


I am looking for suggestions on how to solve this. Anyone done something like this?


Best regards