Consulting

Results 1 to 3 of 3

Thread: Google search from highlighted text

  1. #1

    Google search from highlighted text

    Hi all first time poster on this board.

    I have been learning Excel VBA for the past couple months and I'm wanting to break into Outlook VBA now. I wrote a line of code in Excel that would take the text from the active cell, open a web browser and do a Google search for whatever was in the cell. I want to do the same with Outlook, except by highlighting text, right clicking and select " Search Google for 'whatever text was highlighted' ". Ive posted my Excel code below if it helps. Thanks.


    Sub GoogleActiveCell()
    
    Const Lnk = "I can't post the prefix link to the Google search yet because my account is too young"
    ThisWorkbook.FollowHyperlink Lnk & ActiveCell, NewWindow:=True
    
    End Sub



    Version of the program 2013
    What you want it to do Above
    Cell references, bookmark names, column letters, row numbers, worksheets, styles, whatever pertains to the information at hand Text in the outlook message
    Error messages if any None yet
    If not the entire code, then at least some of it Equivalent Excel code above
    Sample data (before and after sample worksheets, add as attachments here) Equivalent Excel code above
    Politeness and gratitude Many thanks
    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread. Pending

  2. #2
    while it is doable in outlook, it is much harder than in excel

    first it is much harder to return selected text
    is the selected text in a open item (inspector window)?
    or a preview within an outlook explorer window?

    second you would have to either
    create an instance of explorer or similar and navigate to the required url, then read the returned webpage document
    or shellexecute the url to open a default browser window, depending what you want to achieve

  3. #3
    Quote Originally Posted by westconn1 View Post
    while it is doable in outlook, it is much harder than in excel

    first it is much harder to return selected text
    is the selected text in a open item (inspector window)?
    or a preview within an outlook explorer window?

    second you would have to either
    create an instance of explorer or similar and navigate to the required url, then read the returned webpage document
    or shellexecute the url to open a default browser window, depending what you want to achieve


    Hmmm... sounds complicated

Posting Permissions

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