Solved

ms paint to capture signatures

Posted on 2009-04-01
4
1,488 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.

0
Comment
Question by:archerdcrosley
  • 2
  • 2
4 Comments
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 24046836
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.
0
 

Author Comment

by:archerdcrosley
ID: 24116857
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

0
 

Author Comment

by:archerdcrosley
ID: 24116861
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

0
 
LVL 38

Accepted Solution

by:
puppydogbuddy earned 500 total points
ID: 24118347
Ok. Hopefully the info in the following links answer your questions.  There is contradictory information out there.  Many experts claim that MS Paint does not support OLE automation that For what you want to do on the double click event, using sendKeys might do it.   If not, you may want to investigate Ms Photo Draw as an alternative to MS Paint because some of the experts have said tthat it has an automation interface, while ms paint does not.

Information from Microsoft in this link contradicts what the experts are saying....Microsoft says Ms Paint  does support OLE automation but you must follow certain steps to make it an automation server.
                            http://support.microsoft.com/kb/177587

Excerpt From this link:   http://www.eggheadcafe.com/forumarchives/officedeveloperautomation/Feb2006/post25915254.asp
 msPaint does not have an automation interface.  you ought to be able to use appactivate and sendkeys go get  it to work via scripting, as there is not much to do.  You can use shell.run on paint with your file as a parameter.  This will open paint, with your image file loaded.  Then use appactivate and sendkeys to send alt-if to get  the flip and rotate dialog.  Then alt-r2 to selecte rotate 270 deg.  Finally send a cr to click the (default)  

0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PaperPort is a popular document imaging/management product from Nuance Communications (http://www.nuance.com/), previously known as ScanSoft. PaperPort is in widespread use by both individuals (http://www.nuance.com/for-individuals/by-product/paperp…
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
The goal of this is to tech the user how to export photos out of Lightroom and the different options they have. Select which photos you want to export : Select where you want to export and with which options : Export :

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now