usmanazizgroupdocs
12/8/2015 - 8:25 AM

AddCustomPropertyDocFormat.vb

' For complete examples and data files, please go to https://github.com/groupdocsmetadata/GroupDocs_Metadata_NET
' initialize DocFormat
Dim docFormat As New DocFormat(Common.MapSourceFilePath(filePath))

' initialize DocMetadata
Dim metadata As DocMetadata = docFormat.DocumentProperties

Dim propertyName As String = "New Custom Property"
Dim propertyValue As String = "123"

' add boolean key
If Not metadata.ContainsKey(propertyName) Then
    ' add property
    metadata.Add(propertyName, propertyValue)
End If

' save file in destination folder
docFormat.Save(Common.MapDestinationFilePath(filePath))