|
Visual Basic (VB6 and VBA) |
|
Copyright 1999-2001 Christopher Greaves. All rights reserved. Home Page and email to [email protected] |
| If in doubt, record a macro and inspect the entrails! |
Visual Basic Library
This page was last updated on Tuesday, November 27, 2001
Public Function boolCheckSignature(strDoc As String, strSignature) As Boolean ' Procedure : boolCheckSignature ' Description: Check and/or force the signture of a document. ' Copyright: Chris Greaves Inc. ' Inputs: A string. ' Returns: TRUE if the document now has an appropriate signature. ' Assumes: Nothing ' Side Effects: None. ' Tested: By the calls shown below. boolCheckSignature = False ' if signature found then TRUE ' else ask the user is this really the document ' if yes place the signature in the appropriate place, set TRUE ' ask the user "I have signed it, save now?" ' if yes then SaveAs dialogue box ' Else: End If ' else suggest a restart : endif Dim strStamp As String strStamp = strGetStamp(" ", Len(strSignature)) If strStamp = strSignature Then boolCheckSignature = True Else Dim intPlaceSignature As Integer intPlaceSignature = MsgBox("Would you like me to place a signature?", vbYesNo, MacroContainer.Name) If intPlaceSignature = vbYes Then Call strPutStamp(" ", strSignature) boolCheckSignature = True Else End If End If 'Sub TESTboolCheckSignature() 'Dim strSig As String 'strSig = "0123456789" 'Call strPutStamp(" ", strSig) 'MsgBox boolCheckSignature(ActiveDocument.Name, strSig) ' found 'MsgBox boolCheckSignature(ActiveDocument.Name, strSig & "9999") ' not found 'End Sub End Function
| We all knew nothing when we started … |
|
Home Page and Contact Information Send email to [email protected]. This page was last updated Monday, November 19, 2001 |