PublicAPI.Docflow.DocumentVersion.AddDocumentVersion ELMA API Documentation
Add a document version
 
 
Syntax

public DocumentVersion AddDocumentVersion(
	Document document,
	BinaryFile file,
	DocumentVersionStatus versionStatus
)

Parameters

document
Type: Document
Document, to which a new version is added. Object. Access path: PublicAPI.Docflow.Document
file
Type: BinaryFile
The new version to add
versionStatus
Type: DocumentVersionStatus
New version status. Enumeration. Access path: PublicAPI.Enums.Documents.DocumentVersionStatus

Return Value

Type: DocumentVersion
Document Version
Examples

//load the document by ID 
var doc = PublicAPI.Docflow.Document.Load(3);
//get the "Current" version status 
var verStatus = PublicAPI.Enums.Documents.DocumentVersionStatus.Current;
//create a binary file. It will be the attached document verions 
var file = InterfaceActivator.Create<BinaryFile>();
//enter the full file path with the extension
file.ContentFilePath= "c:\\123.txt";
//enter the file name
file.Name = "New file name";
//enter the file creation date
file.CreateDate = DateTime.Now;
//create a file manager
 fileManager = InterfaceActivator.Create<IFileManager>();
//save the file
fileManager.SaveFile(file);

//add the document version 
var docVersion = PublicAPI.Docflow.DocumentVersion.AddDocumentVersion(doc, file, verStatus);

//docVersion - added document version
See Also