We help IT Professionals succeed at work.

ms paint to capture signatures

2,018 Views
Last Modified: 2013-12-02
I've developed a method to capture signatures using ms paint from my access/sql database.  I can open up a customized paint file with a doubleclick on an OLE box within access and store it well.  When I open up the ms paint file, all the toolbars, color palettes and pen-types are activated and showing.  I want to be able to have the paint file open up with those options already clicked off, so that the person signing only sees the box in which they are to sign.  It would also be nice if somehow i could embed a close button that  the signer could click after signing the document (but I'm not too hopeful about that).

The reason I'm doing this is because I find that using signature pads within a terminal services environment to be clumsy, inelegant, and complex.

Comment
Watch Question

try the Shell function to open ms paint with a command line.  MS Paint should have command line switches to load the toobar, color palette, etc.  Check the ms paint Help file.

' Specifying 1 as the second argument of the Shell function opens the application in normal size and gives it the focus.
          Dim RetVal
          RetVal = Shell("c:\windows\system32\mspaint.exe", 1) ' Run MSPaint.
Hope this helps.

Author

Commented:
This is how I'm creating the file.  This code sits within a button entitled Paint.  This code will insert a paint file withina bound object field.  I then doubleclick on the bound object field and bring up a blank sig slate in which I can add a signature.
Private Sub Paint_Click()
 
'Call Shell("C:\WINDOWS\system32\mspaint.exe", 1)
'sFile = [Forms]![KioskVisitNewMaster]![LastName] & [Forms]![KioskVisitNewMaster]![FirstName] & [Forms]![KioskVisitNewMaster]![BirthDate]
 
sFile = [Forms]![KioskVisitNewMaster]![LastName] & [Forms]![KioskVisitNewMaster]![FirstName] & [Forms]![KioskVisitNewMaster]![MiddleInitial] & Format([Forms]![KioskVisitNewMaster]![BirthDate], "mmddyy") & "." & Format(Forms![KioskVisitNewMaster]![KioskVisitNew].Form![KioskDate], "mmddyy") & "." & Hour(Now) & Minute(Now)
 
 
FileCopy "e:\signature\crosley.bmp", "e:\signature\" & sFile & ".bmp"
'FileCopy "c:\crosley.bmp", "c:\" & sFile & ".bmp"
 
    PaintSig.Class = "Paint.Picture"    ' Set class name.
    ' Specify type of object.
    PaintSig.OLETypeAllowed = acOLELinked
    ' Specify source file.
    
    PaintSig.SourceDoc = "e:\signature\" & sFile & ".bmp"
    
    ' Specify data to create link to.
    PaintSig.SourceItem = ""
    ' Create linked object.
    PaintSig.Action = acOLECreateLink
    ' Adjust control size.
    PaintSig.SizeMode = acOLESizeZoom
    
End Sub

Open in new window

Author

Commented:
This is how I'm creating the file.  This code sits within a button entitled Paint.  This code will insert a paint file withina bound object field.  I then doubleclick on the bound object field and bring up a blank sig slate in which I can add a signature.
Private Sub Paint_Click()
 
'Call Shell("C:\WINDOWS\system32\mspaint.exe", 1)
'sFile = [Forms]![KioskVisitNewMaster]![LastName] & [Forms]![KioskVisitNewMaster]![FirstName] & [Forms]![KioskVisitNewMaster]![BirthDate]
 
sFile = [Forms]![KioskVisitNewMaster]![LastName] & [Forms]![KioskVisitNewMaster]![FirstName] & [Forms]![KioskVisitNewMaster]![MiddleInitial] & Format([Forms]![KioskVisitNewMaster]![BirthDate], "mmddyy") & "." & Format(Forms![KioskVisitNewMaster]![KioskVisitNew].Form![KioskDate], "mmddyy") & "." & Hour(Now) & Minute(Now)
 
 
FileCopy "e:\signature\crosley.bmp", "e:\signature\" & sFile & ".bmp"
'FileCopy "c:\crosley.bmp", "c:\" & sFile & ".bmp"
 
    PaintSig.Class = "Paint.Picture"    ' Set class name.
    ' Specify type of object.
    PaintSig.OLETypeAllowed = acOLELinked
    ' Specify source file.
    
    PaintSig.SourceDoc = "e:\signature\" & sFile & ".bmp"
    
    ' Specify data to create link to.
    PaintSig.SourceItem = ""
    ' Create linked object.
    PaintSig.Action = acOLECreateLink
    ' Adjust control size.
    PaintSig.SizeMode = acOLESizeZoom
    
End Sub

Open in new window

This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.