Results 1 to 9 of 9
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    1,919

    Launch URL from code

    I'd like to launch a URL from code and
    paste the contents of the clipboard into
    the field currently displaying the cursor.

    I already have the text string on the
    clipboard, I just can't seem to find any
    methods that carry out a paste function.

    I'm assuming I can Dim an application
    object like IE and pass the URL?



    Thanks,
    Bill

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Try:
    Code:
    Dim strUrl As String
    strUrl = "http://www.google.com"
    Call Shell("explorer.exe " & strUrl, 5)
    Btw, that was the first hit on a Google search for "Open IE Access VBA"

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    The main question is what VBA method do I use to "paste" the contents of the clipboard into the "single" entry field in the webpage. OR, can that be passed in the Shell string somehow.

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    I don't think VBA supports clipboard operations. Unless I'm wrong there, your options would be to:
    A) Use this (somewhat complicated)
    B) Assuming the contents on the clipboard are something from a textbox, you can place a button (cmdCopy) which will write (UPDATE Query) the contents of the textbox to a table. Then you can use the shell command and do a DLookup to pull the contents from the table to the variable.

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    I already have the simple string in a VBA variable. I had placed that string on the clipboard in the believe that was the path go paste it into the one and only text field in the URL I would Shell to. I'll have a look at Allen's stuff and see if that opens any solutions.

  6. #6
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    If you have the string that contains the URL as a variable already, then the shell command should be all you need. It will open up explorer and go to whatever url is in the string.

  7. #7
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    I think you're confusing the URL string with the data string I want to paste. I understand the use of the URL string as applied to the Shell. However, I have a data string I want to paste into a data input pane that appears when the URL gets opened. Sort of akin to how fields of a webpage form would be populated from a cookie.

  8. #8
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Oh so you want to interact with the web page once it's opened. That's outside my pay grade. I'm no good to you there, sorry.

  9. #9
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Well, thanks for your thoughts. Maybe Allen will spot this and offer his suggestions.....or his condolences.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Form Launch Problem
    By paddon in forum Programming
    Replies: 10
    Last Post: 12-18-2010, 04:18 PM
  2. Replies: 5
    Last Post: 03-03-2010, 12:03 PM
  3. Replies: 0
    Last Post: 08-26-2008, 09:22 AM
  4. Replies: 0
    Last Post: 01-18-2007, 07:07 PM
  5. HOW DO I: Add or Launch Report from a Form?
    By ba1959nh in forum Forms
    Replies: 2
    Last Post: 09-25-2006, 04:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums