AppActivate will not retain focus

G

Gina

All,

A co-worker is trying the following... any advise... Thanks

I am trying to take a screen print and pasting it into MS Paint however,
Paint won’t retain focus so Sendkeys sends the key strokes directly to Access
and I get a blank picture


On Error GoTo BadStart



keybd_event VK_MENU, 0, 0, 0

keybd_event VK_SNAPSHOT, 0, 0, 0

keybd_event VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0

keybd_event VK_MENU, 0, KEYEVENTF_KEYUP, 0



Shell "mspaint.exe",1

AppActivate "untitled - Paint", True



PauseTime = 4 ' Set duration.

Start = Timer ' Set start time.

Do While Timer < Start + PauseTime

DoEvents ' Yield to other processes.

Loop

Finish = Timer ' Set end time.

TotalTime = Finish - Start



SendKeys ("^v"), True

SendKeys ("^s"), True

SendKeys "C:\Temp\Error.bmp", True

SendKeys ("{ENTER}"), True

SendKeys ("%{F4}")

Exit Function

Thank you as always.
 
L

Larry Daugherty

Nothing about MS Access in your post.

Please post to an appropriate newsgroup.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top