Custom File Properties

Viewed 17396

I need to following:

In my application I have documents. Documents which need to be checked in and out all the time. When I check a Document out of my application I need to add Custom Properties to the file so I can identify it later when I'm going to checkin the document.

I've tried to use the OleDocumentProperties from DSOFile using the following code, but no success:

 // Adding custom properties to file (Parameters: FileName, custom property name, value, debug: true/false
 DocumentProperties.WriteDocumentProperty(filename, "dms_dossiernummer", _dossiernummer.ToString(), false);
 DocumentProperties.WriteDocumentProperty(filename, "dms_zaaknaam", ReturnZaaknaam(_dossiernummer), false);
 DocumentProperties.WriteDocumentProperty(filename, "dms_verantw_medew", ReturnVerantwMedew(_dossiernummer), false);
 DocumentProperties.WriteDocumentProperty(filename, "dms_document_path", path, false);
 DocumentProperties.WriteDocumentProperty(filename, "dms_bestandsnaam", bestandsNaam, false);
 DocumentProperties.WriteDocumentProperty(filename, "dms_bestands_id", bestandId, false);
 DocumentProperties.WriteDocumentProperty(filename, "dms_is_checkedout", "true", false);
 DocumentProperties.WriteDocumentProperty(filename, "dms_dossier_map_id", dossierMapId, false);
 DocumentProperties.WriteDocumentProperty(filename, "dms_bestand_versie_nummer", Queries.Dms.Selects.GetDocumentVersion(
                                                        Convert.ToInt32(bestandId)).ToString(), false);
 DocumentProperties.WriteDocumentProperty(filename, "dms_bestands_locatie", path, false);

Does anyone know another way to add Custom File Properties to a file?

4 Answers
Related