Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving / emailing sinlge excel sheet, not entire workbook BRCorprado Excel Discussion (Misc queries) 2 September 17th 09 10:34 PM
Emailing an Excel Workbook with Links Frank G Links and Linking in Excel 2 June 29th 07 03:54 PM
Emailing an Excel Workbook with Links Frank G Excel Discussion (Misc queries) 0 April 11th 07 07:46 PM
Emailing workbook from Excel Georgie8888 Excel Programming 3 September 28th 06 02:04 PM
emailing a workbook from within excel Damien Excel Programming 3 August 2nd 06 01:54 PM


All times are GMT +1. The time now is 09:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"