1

I'm trying to figure out a way to have a specific web browser open (Internet Explorer for example) when a URL is clicked using VB.net

As I have it now, my code creates and sends out an email that displays a title and a hyperlink for the user to click on. Right now, the hyperlink opens the default browser, but I want to make it always open Internet Explorer.

enter image description here

The code below is what I have for displaying the Hyperlink. It displays "View Document" and the prints the hyperlink underneath. The hyperlink in this case is stored in my LinkLabel since its already part of the application somewhere else

What do I need to add to the code so that it defaults to Internet Explorer when it is clicked? enter image description here

I have come across suggestion of using the full file path to Internet Explorer on the C: Would that work?

2
  • 1
    My first question would be why would you want to do this? What if the user doesn't have Internet Explorer installed? Which is incredibly likely now a days with use of mobiles and choice of browser Apr 6, 2017 at 14:58
  • 1
    Good question. In this particular case, the link behaves best in Internet Explorer and every computer using this application will also have Internet Explorer installed so that won't be an issue
    – Justin
    Apr 6, 2017 at 14:59

1 Answer 1

1
<a href=microsoft-edge:http://example.com>my link</a>

Update:

... & "<a href=microsoft-edge:" & LinkLabRequests.text & ">my link</a>" + ...
4
  • How will that prompt it to be Internet Explorer?
    – Justin
    Apr 6, 2017 at 15:05
  • Since there is no standard protocol such as microsoft-edge exist Microsoft Windows handles it and believe me they won't miss that chance.
    – Xaqron
    Apr 6, 2017 at 15:08
  • It's not working. It has a problem with LinkLabRequest for some reason. Is there another way?
    – Justin
    Apr 6, 2017 at 15:28
  • Try changing your last line from the screenshot to this: mvarBody = mvarBody & String.Format("View Document: <a href={0}>Description for link</a>", linkLabRequests.Text) Apr 6, 2017 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.