Site icon bVisual

Using MailTo Protocol in Visio Shapes

A newsgroup question asked whether you can send an email from a Visio shape, so I thought it was time to document an example of just that..

In this example, I have added four Shape Data rows for the Address, Subject, CC and BCC fields…

image

However, I have used the Screen Tip cell for the message body because it is the only out-of-the-box dialog that allows you to enter multi-line text into a Shape Cell.

To open the Screen Tip via the right mouse menu, I added the formula =DOCMD(1685) to an Actions row.

To force the Hyperlink.Address cell of the new Hyperlink.Mail row to update whenever any of the values in the four Shape Data rows or the Screen Tip is changed, I added the following formula to a new User-defined cell called, MailToTrigger:

=DEPENDSON(Prop.Address,Prop.Subject,Prop.CC,Prop.BCC,Comment)+SETF(GetRef(Hyperlink.Mail.Address),"=""MailTo:"&Prop.Address&"?Subject="&Prop.Subject&"&CC="&Prop.CC&"&BCC="&Prop.BCC&"&Body="&Comment&"""")

That’s it! Just enter email addresses, a subject and body, then your mail client will be opened pre-filled from the right-mouse menu of the VIsio shape, or, of course, from a SaveAs web page.

You can read about the MailTo protocol here: http://msdn.microsoft.com/en-us/library/aa767737.aspx

Exit mobile version