ESignature Object Example
To use the ESignature object from VBA, declare an object variable and create the object by calling CreateObject( ). You can then access the ESignature object's methods through the object variable.
The sample code below illustrates how to use the ESignature object in VBA applications.
Dim ESig As Object
Dim bNodeSignEnabled As Boolean
Dim bSigRequired As Boolean
Dim Value as Variant
'Create the ESignature object
Set ESig = CreateObject (“ElectronicSignature.ESignature")
'Check if node is enabled for electronic signature
ESig.IsNodeSignEnabled bNodeSignEnabled
If bNodeSignEnabled = True Then
'Check if data source requires electronic signature
ESig.Initialize ("Fix32. THISNODE.DO1.F_CV")
ESig.IsSignatureRequired 0, bSigRequired
If bSigRequired = True Then
'Capture the signature and write the new value
Value = 1
ESig.GetSignatureAndWriteValue 0, Value
Else
'Signature not required for this data source, just write the value
End If
Else
'Signature not enabled on this node, just write the value
End If