Option Public Option Declare Dim s As NotesSession Dim db As NotesDatabase Dim agent As NotesAgent Dim SigPlus1 As Variant ' Sig control object Dim view As NotesView ' view containing all signature docs to be processed Dim doc As NotesDocument ' current doc Dim tmpstring As String ' temporary working string Dim sigfilename1 As String ' sig img file path/name Dim numpoints As Integer ' number of points in sig - used to verify sig loaded successfully Dim filenum As Integer Dim flag As Variant ' success flag Sub Initialize ' this is a test routine for getting key out of signature form (as hex) and converting to img on file On Error Goto Errorhandler Print "Initializing Agent Variables..." Set s = New NotesSession Set db = s.CurrentDatabase Set agent = s.CurrentAgent Set view = db.GetView( "Signatures" ) Set doc = view.GetFirstDocument ' create the sig control object Set SigPlus1 = CreateObject( "SIGPLUS.SigPlusCtrl.1" ) Call SigPlus1.InitSigPlus Call SigPlus1.DisableMessageBoxes(1) Call SigPlus1.Cleartablet() ' set ctrl to nothing ' loop through docs Do Until (doc Is Nothing) ' use order_no as unique key for this process, create the export filepath sigfilename1 = |c:\| & doc.KEYFIELD(0) & |.jpg| ' setup first signature export/conversion tmpstring = doc.HEXFIELD(0) If loadSigPlus1(tmpstring, 0, 1, "") = 1 Then ' write out image SigPlus1.ImageFileFormat=4 ' 4=jpg, 100% SigPlus1.ImageXSize = 1000 SigPlus1.ImageYSize = 300 SigPlus1.JustifyMode=5 ' scale but keeps proportions SigPlus1.WriteImageFile(sigfilename1) Print "Image file written...." End If Set doc = view.GetNextDocument( doc ) Loop Exit Sub ErrorHandler: Messagebox "Error" & Str(Err) & ": " & Error$ Exit Sub End Sub Function loadSigPlus1( sigstring As String, encryptflag As Integer, compressflag As Integer, keydata As String) ' sets the input stream of the signature key Print "Loading Signature Data...." Call SigPlus1.Cleartablet() ' Clears the control prior to keying and signature import SigPlus1.TabletState = 0 ' Sets the tablet disconnected SigPlus1.EncryptionMode = 0 ' Clears EncryptionMode prior to keying On Error Goto Errorhandler ' using settings passed, retrieve the signature If compressflag=0 Then SigPlus1.SigCompressionMode = 0 Else SigPlus1.SigCompressionMode = 1 End If If encryptflag=1 Then SigPlus1.AutoKeyStart SigPlus1.AutoKeyData = keydata SigPlus1.AutoKeyFinish SigPlus1.EncryptionMode = 1 ' or Encryption Mode = 2; Else SigPlus1.EncryptionMode = 0 SigPlus1.SigString = sigstring End If numpoints = SigPlus1.NumberofTabletPoints If numpoints=0 Then ' there were no points loadSigPlus1=0 Print "No Signature Loaded" Else ' there were points loadSigPlus1=1 Print "Signature Loaded" End If Exit Function ErrorHandler: Messagebox "Error" & Str(Err) & ": " & Error$ loadSigPlus1=0 End Function