HI All,
I have written a small app that adds a document (tiff image) with some field data but I keep getting an error when I try to import an image file attached to the visual studio solution.
The error is "The object is not identified, and cannot be locked or read from."
and the code is
DocID = Document.Create(WorkflowDocPath & DocName, VolumeName, EntryNameOption.AutoRename, mySession)
Dim ei As EntryInfo = Entry.GetEntryInfo(DocID, mySession)
ei.SetTemplate(LFTemplateName)
ei.Save()
'Import Image
dim myresourcePath as string = System.IO.Path.GetFullPath(Application.StartupPath)
Dim MyDocument As New DocumentInfo(mySession)
Dim di As New DocumentImporter
di.Document = MyDocument
di.OcrImages = False
di.ImportImages(myresourcePath & "Image1.tif") 'ERROR Here
'Add metadata
Dim FVC As FieldValueCollection = ei.GetFieldValues
FVC.Add("Template", TemplateName)
FVC.Add("Current Name", CurrentName)
FVC.Add("New Name", NewName)
FVC.Add("Current Code", CurrentCode)
FVC.Add("New Code", NewCode)
ei.Lock(LockType.Exclusive)
ei.SetFieldValues(FVC)
ei.Save()
ei.Unlock()
The file is in the folder windows sees it as a tiff file and I can open it.
Have I missed something?
Andrew