Good morning everybody. Thanks for your attention and apologies in advance if this has been asked before.
I have a spreadsheet with several contacts and emails. At work, we send emails to these contacts on a regular basis, tailored through some specific templates. I've created a code that, when you click a mailto: hyperlink, a small form with a dropdown menu shows up so we can select the template to use, and when clicking a command button, it composes an email using Outloook, populating the body of the email with the template and the contact, company name, subject, etc.
All of that works perfectly.
However, it not only opens the userform; it also opens a new, blank email, as it would without the code.
Is there any way to prevent that from happening? To only execute my code when clicking the email address?
Thanks in advance
EDIT: the Worksheet_FollowHyperlink cannot be trapped. My solution was to do this on Worksheet_SelectionChange and verifying if the Target had a "@" in the value, which would ensure it was an email, then trigger my code.
Bookmarks