I've been fighting with this for 2 days now searching and reading, but to no avail. So someone please help me. All I want to do is set the value of some UPDs in a file that is in that vault. When I run the code below I get...
ArgumentNullException was Unhandled
Value cannot be Null
Parmeter Key Name
This occurs on the vaultExplorer.UpdateFileProperties(oFile, Props) line of code. The array that supplies the values (MetaData) has no Null elements.
Here is the whole thing:
Dim aryPropIDs() AsInteger = {136, 82, 51, 116, 133, 134, 135, 101, 117}
Dim aryPropNames() AsString = {"Rev", "Title", "State", "Initial Release Date", "Dwg Size", "Content", "Component No", "Project", "Unit Type"}
Dim i AsInteger = 0
Dim Props AsNew System.Collections.Generic.Dictionary(OfPropDef, Object)
For i = 0 To 8
'Ignor the file State
If i <> 2 Then
Try
Dim obj AsNewPropDef
obj.Id = aryPropIDs(i)
If i = 3 And MetaData(i) <> ""Then
'Create a date object
Dim RelDate AsNewDate
RelDate = MetaData(i)
obj.DfltVal = RelDate
Props.Add(obj, aryPropNames(i))
Else
'Update Properties:
obj.DfltVal = MetaData(i)
Props.Add(obj, aryPropNames(i))
If i = 1 Then
'Put Title value in Description Also
Dim oDesc AsNewPropDef
oDesc.Id = 90
oDesc.DfltVal = MetaData(i)
Props.Add(oDesc,
"Description")
EndIf
EndIf
Catch
ChkInError = ChkInError & vbNewLine &
"Error updating property " & i & ": " & aryPropNames(i)
ErrorOccured =
True
PropUpdated =
False
EndTry
EndIf
Next
vaultExplorer.UpdateFileProperties(oFile, Props)
Hi Mike,
I don't see what is wrong looking at the code example. Can you send me a small but buildable example I could use to test this? Also what version of Vault are you running?
Did you see the example in this blog post?
http://adndevblog.typepad.com/manufacturing/2013/07/vault-2014-iexplorerutil-vb-example.html
Can you edit that example to work with the file and property in your vault and let me know the results you get?
Thanks,
Wayne
My appologies Wayne. I am currently on the road and have not had access to the files to give you an example. The files are of 2 types pdf and tif. I am using Vault Pro 2013.