Hi,
From within the ICommand Execute method I have some code that allows me to check out a file and copy it using the GetCopy method. This part is ok.
I then want to check this in as a new document.
So basically declared a new NRTDocument built it up from the settings from the existing one and tried to check it in. Where [sourceDocument] is the copy of the document I did a GetCopy on.
I get an error "Document Profile is Invalid".
Also I'm unable to iterate throught the errors object, supposed to be a type safe array of NRTProfileError objects which i was unable to cast.
This is the code snippet below:
NRTDocument newDocument = sourceDocument.Database.CreateDocument();
newDocument.SetAttributeValueByID(AttributeID.nrAuthor, sourceDocument.Author);
newDocument.SetAttributeValueByID(AttributeID.nrOperator, sourceDocument.Operator);
newDocument.SetAttributeValueByID(AttributeID.nrType, sourceDocument.Type);
newDocument.SetAttributeValueByID(AttributeID.nrClass, sourceDocument.Class);
Object errors = null;
newDocument.CheckIn(
@C:\test.doc, CheckinDisposition.nrNewDocument, CheckinOptions.nrDontKeepCheckedOut, ref errors);