Consulting

Results 1 to 4 of 4

Thread: Solved: Send keys to print screen

  1. #1

    Solved: Send keys to print screen

    I'm trying to copy the active form window to the cliboard so that I can paste it into another application. Doing it manually works just fine (ctrl + alt+ print screen). How do I use the "send keys method" to send to those keys? I've tried everything and I know its probably simple but I can't seem to get it to work. Here's what I have:

     SendKeys "{^}{%}{PrtSc}"

  2. #2
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,676
    Location
    Honestly, I would caution you from using SendKeys for a number of different reasons. Mainly because they can be intercepted- the SendKeys will go to whatever window has focus, which could be a security risk, depending on what you're working on.

    I suggest looking at this article that shows how to use API calls to capture a screen at the end of the article.

    If you have to use SendKeys, then use:

    [VBA]Sub PrintTheScreen()
    Application.SendKeys "(%{1068})"
    End Sub[/VBA]
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


  3. #3
    I tired your code and it returned the following error. "Compile ERror: Method or Data member not found"

    I don't know if I told you that I'm trying to copy an active form in MS Access. Is that the problem?

  4. #4
    Thanx alot for that information. I used the API code and it worked like a charm. thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •