Solved

ms paint to capture signatures

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

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…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

813 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