Solved

ms paint to capture signatures

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In a previously published article (http://www.experts-exchange.com/articles/10331/Automatic-Duplex-Scanning-in-PaperPort-Versions-11-12-14.html) here at Experts Exchange, I explained how to achieve duplex (double-sided) scanning in Nuance's PaperPor…
PaperPort 14.5 Patch 1 update is often not detected or downloaded automatically. This article provides direct download links to solve the problem for retail (non-bundled) versions of the Standard and Professional editions, as well as the Professiona…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

747 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

13 Experts available now in Live!

Get 1:1 Help Now