Results 1 to 4 of 4

Thread: Setting the clipboard content of the WebBrowser object

  1. #1
    Guest

    Smile

    Hi all,

    I'm trying to set the content of the clipboard to be the words selected within the WebBrowser object. I've tried SendKeys "^C" but it didn't work. Anybody knows how to do this?

    Thanks for any help.

    Rgds,
    David.

  2. #2
    Guest
    I'm not sure, but this should work:
    Code:
    Me.SetFocus
    WebBrowser1.SetFocus
    SendKeys "^C", True
    MsgBox Clipboard.GetText
    It worked for me.

  3. #3
    Guest

    Unhappy I've just tried it but it won't work

    I tried it, but it didn't work

    What I want to do is for user to highlight words within the WebBrowser object by drag-select the mouse and then click a "Find" button. Therefore I need to capture the words which is highlighted by user which is supposed to be stored in the clipboard.

    Is there any other way to do it besides SendKeys "^C" ?

    If sendkeys is the only way to capture the highlighted words, what is the proper way to code it?

    Any help is very appreciated.

    Rgds,
    David.

  4. #4
    Guest
    First of all, my mistake, you should lose the line "Me.SetFocus", I wrote it here before I got the code to work, so it shouldn't be there.
    I'll try to find some other solution.

Posting Permissions

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



Click Here to Expand Forum to Full Width