简体   繁体   中英

How can I intercept Outlook hyperlink clicks to run c# code instead?

I have an Outlook add-in, which transform plain text reference numbers (ticket numbers) to clickable hyperlinks. When clicked, they open up the default browsers (as you would except). That works just fine, but now I want to intercept this click, to run c# code of my add-in instead. Similar to how Outlook intercepts clicks on mailto-links to known addresses (it shows the contact card instead).

How can I achieve that?

The Word Object Model does not have any events that fire when a user clicks on links (Word renders HTML messages in Outlook). The best you can is create your own url handler (eg MyHandler:somelink). You can then replace the links in the HTML body.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM