Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Emailing a Hyperlink of an Excel Workbook.
Sub mail_hyperlink()
Dim objoutlook As Object Dim objolns As Object Dim objrecipient As Object filll = "file://S:\Call Stats Report\" & ActiveWorkbook.Name namm = ActiveWorkbook.Name mess = "<a href=""" & filll & """" & namm & "</a" Set objoutlook = CreateObject("OUTLOOK.APPLICATION") Set objolns = objoutlook.getnamespace("MAPI") objolns.logon With objoutlook.CreateItem(olMailItem) .To = "paulwadsworth@XXX" .Subject = "Daily Call Stats" .HTMLBody = "Please find attached a hyperlink to the calls stats for yesterday. <br" & mess _ & "<br<brRegards<brPaul Wadsworth." .Save .Send End With objolns.logoff Set objoutlook = Nothing Set objolns = Nothing Set objrecipient = Nothing End Sub That code is Exactly as I have the email, the only thing changed is my email address. I haven't left anything out. When I run the macro the email sends fine, but when trying to open the hyperlink I get a "Locate Link Browser" window, and under "Types of File" I can only select "Executable File". I've tried without "file://" i've also tried various number of " on the "mess =" line. Someone I know sent me a file to mail a hyper link and the code was totally different: Set olApp = New Outlook.Application Instead, but still the same error occurs. At the end of the day, i'm trying to stop sending files on email, and send hyperlinks instead, so that people's emails are filled up with stuff. Can anyone help me out? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Emailing a Hyperlink of an Excel Workbook.
You probably don't have the S: drive mapped the same. Drive using the
Network name of the drive instead of the S drive. Go to a window Explorer (not internet) and go to menu Tools - Disconnect network dirve. You will see the mapping of the S dirve. Replace S: path in your macro with \\Netowrk Name "PaulW" wrote: Sub mail_hyperlink() Dim objoutlook As Object Dim objolns As Object Dim objrecipient As Object filll = "file://S:\Call Stats Report\" & ActiveWorkbook.Name namm = ActiveWorkbook.Name mess = "<a href=""" & filll & """" & namm & "</a" Set objoutlook = CreateObject("OUTLOOK.APPLICATION") Set objolns = objoutlook.getnamespace("MAPI") objolns.logon With objoutlook.CreateItem(olMailItem) .To = "paulwadsworth@XXX" .Subject = "Daily Call Stats" .HTMLBody = "Please find attached a hyperlink to the calls stats for yesterday. <br" & mess _ & "<br<brRegards<brPaul Wadsworth." .Save .Send End With objolns.logoff Set objoutlook = Nothing Set objolns = Nothing Set objrecipient = Nothing End Sub That code is Exactly as I have the email, the only thing changed is my email address. I haven't left anything out. When I run the macro the email sends fine, but when trying to open the hyperlink I get a "Locate Link Browser" window, and under "Types of File" I can only select "Executable File". I've tried without "file://" i've also tried various number of " on the "mess =" line. Someone I know sent me a file to mail a hyper link and the code was totally different: Set olApp = New Outlook.Application Instead, but still the same error occurs. At the end of the day, i'm trying to stop sending files on email, and send hyperlinks instead, so that people's emails are filled up with stuff. Can anyone help me out? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saving / emailing sinlge excel sheet, not entire workbook | Excel Discussion (Misc queries) | |||
Emailing an Excel Workbook with Links | Links and Linking in Excel | |||
Emailing an Excel Workbook with Links | Excel Discussion (Misc queries) | |||
Emailing workbook from Excel | Excel Programming | |||
emailing a workbook from within excel | Excel Programming |