Solved

ms paint to capture signatures

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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 …
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…

742 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