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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email hyperlink from excel.

Status
Not open for further replies.

striker83716

Technical User
Jul 28, 2002
76
US
Hi all and thanks for your help in advance.

I have a xlt file (excel template) that is stored on the company network. The user opens this file and assigns a shipping package number. This number is then used in the naming of the new file on the network as an xls file. What I would like to do is create a button on this Excel worksheet that does the following.
Starts an email & inserts a hyperlink in the body of the email.

This hyperlink will take the receipent of the email back to the excel workbook.

Thanks guys, I really enjoy the site and have been able to find most of my answers from searching, but have not come up with anything for this problem.

Rob
 
Rob,

I can't take any credit for the code below, see the rem'd out portions that show which websites they come from. When it comes to html, I don't have a clue. If the code below doesn't do the trick, please let me know. Notice that you will have to reference your workbook where I have test.xls.

Code:
Sub Mail_workbook_Outlook()
'From [URL unfurl="true"]http://www.rondebruin.nl/sendmail.htm[/URL]
'and from [URL unfurl="true"]http://www.experts-exchange.com/Databases/Q_20878519.html[/URL]
'You must add a reference to the Microsoft outlook Library
    Dim OutApp As Outlook.Application
    Dim OutMail As Outlook.MailItem
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(olMailItem)
    With OutMail
        .To = "youremail@yourhost.com"
        .CC = ""
        .BCC = ""
        .Subject = "This is the Subject line"
        .HTMLBody = "<html><head><title>...</title>...</head><body>...<a href=c:/test.xls>clickhere</a>...</body>"
        .Display   'or when your ready to really email use .Send
    End With
    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub

Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top