Solved

ms paint to capture signatures

Posted on 2009-04-01
4
1,585 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Adults who share images on social media aren’t the only ones who need to worry about their privacy. Our culture’s tendency to share every move and celebration affects the privacy of our children, too.
The goal of the tutorial is to teach the user what exposure is and how to use the exposure slider. Analyze the photo that you want to edit, then adjust the exposure slider to your liking.
The goal of the tutorial is to teach the user how to make his/her own presets while editing so it is easier to edit there photos. Create a preset you like and copy that setting then save it in to your presets folder.

695 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