none
Retrieve hyperlink from mail RRS feed

  • Question

  • Hello everyone,

    Is it possible to get from a received e-mail the hyperlink that you want? And what is the best approach to do this?

    Greetings,

    Spacelama

    Tuesday, June 12, 2012 7:17 PM

Answers

  • Word.Document wordDoc = mailItem.GetInspector.WordEditor;

    foreach(HyperLink link in wordDoc.Hyperlinks)

    • Marked as answer by SpaceLama Friday, June 15, 2012 11:24 AM
    Friday, June 15, 2012 11:23 AM

All replies

  • You can read the HTMLBody property and either parse it explicilty in your code or load it into an IHTMLDocument object and use the DOM to loop through all links.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Tuesday, June 12, 2012 7:48 PM
  • Oke, and what is the best method? Do you have some articles on this subject?

    Greetings,

    Spacelama

    Tuesday, June 12, 2012 7:55 PM
  • if your code wil;l work against outlook 2007 or higher you can obtain Word's document class from mailItem.GetInspector.WordEditor

    and use Document.HyperLinks collection to access all links in mail's body

    Tuesday, June 12, 2012 8:09 PM
  • So are you guys saying I need to convert the body of an e-mail to a word document? Because I would like to add some coding within outlook to be able to find hyperlinks in e-mails and then use them. Is there any tutorial on this? If i search on hyperlinks and outlook then I only find tutorials how to add them to a body... what is kind of useless in my case.

    It is going to be tricky to find the specific hyperlink tho, because the e-mail has much embedded coding which I dont understand at all when reading it. Cant find the exact link within the source view that I see when I go to a certain page.

    I hope I could get some more help? Articles, examples?

    Thanks!

    Greetings,

    Spacelama

    Wednesday, June 13, 2012 7:21 PM
  • no conversion is needed, outlook by itself exposes word API for retrieval and manipulation of mails in reading and composing scenarios. Just use word's api to get all hypelinks.

    Thursday, June 14, 2012 6:19 AM
  • Oke, thanks. Any example for this?
    Friday, June 15, 2012 11:18 AM
  • Word.Document wordDoc = mailItem.GetInspector.WordEditor;

    foreach(HyperLink link in wordDoc.Hyperlinks)

    • Marked as answer by SpaceLama Friday, June 15, 2012 11:24 AM
    Friday, June 15, 2012 11:23 AM