Need VBcode to open msPaint from Access 2007

  • Thread starter Thread starter Citipool
  • Start date Start date
C

Citipool

Does anyone have VB code that I could use to have the option of clicking on
cmd button in a form to open msPaint? Thank you :)
 
Thanks Arvin. I have to admit that I am learning my way up the ladder when it
comes to VB. I've added the code you suggested but I get an error
message:"The expression On click you enetered as the event property setting
produced the following error: Invalid outside procedure." Umm, now what?
any insight?
 
I have to admit that I am learning my way up the ladder when it
comes to VB. I've added the code you suggested but I get an error
message:"The expression On click you enetered as the event
property setting produced the following error: Invalid outside
procedure." Umm, now what? any insight?

More information needed.

Where did you put the code?

Which line is producing the error?
 
You sure about that, Arvin? Isn't the ShellExecute API intended to open a
file in the appropriate application based on its extension? In other words,
Call fHandleFile("C:\Folder\File.doc", WIN_NORMAL) would open File.doc in
Word.

In this case, I'd forgo the API and simply use

Private Sub cmdPaint_Click()
Shell "C:\Windows\System32\mspaint.exe", vbNormalFocus
End Sub


--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
(no e-mails, please!)
 
Back
Top