Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mailto on a UserForm

Status
Not open for further replies.

Pcfred

Technical User
Jan 15, 2002
54
US
I'm trying to create a label on a Excel Userform that is an email hyperlink but I can't seem to figure it out. Any Ideas?

thanks
PcFred
 
Do you mean:

1. It shows an email address, based on some logic on the form?

2. It creates and sends an email?




Gerry
 
Just a label with my name on it that when clicked on it launches the mail service an puts my name in the 'To:' box but doesn't automatically send. just like clicking on a mailto: hyperlink on a web page.
 
It depends on what mail service you are using. However, if you can make a reference to that service within Excel, then sure, you can do that.

1. make a object reference to the mail client
2. create a new mail item
3. display it (I assume)

Gerry
 
I found the code for it. Thanks anyway.

Sub Send_Msg()
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
With objMail
.To = "name.domain.com"
.Subject = ""
.Body = ""
.Display
End With
Set objMail = Nothing
Set objOL = Nothing


End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top