Results 1 to 2 of 2
  1. #1
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Pittsburgh, PA
    Thanked 10 Times in 9 Posts

    Paste into an Application (Access 2003)

    I have some VBA code to open another application when I click a button in Access. When the application is opened, I press CTRL+V to paste some clipboard text into it. Then I press Enter to execute the application. (The application is the label editing program for a label printer; the clipboard text is a mailing address that I want to put onto a label.)

    Is there a way to have the pasting (and hopefully the Enter pressing) take place automatically when the application is open?
    Lou Sander
    Pittsburgh, Pennsylvania

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Paste into an Application (Access 2003)

    I don't know if the label editing program has an API (application program interface). If not, you could try SendKeys, but it it not really dependable: it simulates keystrokes, but they might end up being handled by another application if that happens to get the focus.
    Private Sub cmdSomething_Click()
    SendKeys "^V{ENTER}"
    ' instruction to open label editing program goes here
    End Sub</code>

Posting Permissions

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