DIAdem Help

Method: Exists for DocumentProperties <DataPlugin>

  • Updated2024-09-12
  • 1 minute(s) read

Method: Exists for DocumentProperties <DataPlugin>

Checks whether a property with a specific name already exists in a document. A document can be an Office file in XML format, a PDF, JPEG, PNG, or TIFF file.

bExists = Object.Exists(sName)
ObjectDocumentProperties <DataPlugin>
Object with this method
sNameString
Specifies the name of the custom property.
bExistsBoolean
Specifies whether the custom property with the specified name already exists (TRUE) or not (FALSE).

The following example only transfers the properties of a specific namespace of the document into the data set properties if this document was edited by the author Meier.

Dim sNamespace, oMyNamespaceProps, oMyProp
If Document.Properties.Exists("author") Then
  If Document.Properties("author").Value = "Meier" Then
    sNamespace = "http://ns.adobe.com/xap/1.0/"
    If Document.Namespaces.Exists(sNamespace) Then 
      Set oMyNamespaceProps = Document.Namespaces(sNamespace).Properties
      For each oMyProp in oMyNamespaceProps
        Call Root.Properties.Add(oMyProp.Name, oMyProp.Value)
      Next  
    End If
  End If
End If

Log in to get a better experience