Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default How to e-mail a shortcut to the active workbook

I am using Office 2003 with Windows XP.

Anyone know how to e-mail a shortcut to the currently active workbook?
I have tried using the following code, but this sends a copy of the file not
a LINK or SHORTCUT to the original file:

Public Sub SendFileLink()
Dim oOutlook As New Outlook.Application
Dim oMessage As Outlook.MailItem
Dim wReviewSheet As Excel.Worksheet
Set oMessage = oOutlook.CreateItem(olMailItem)
ThisWorkbook.Save
With oMessage
.Subject = "Subject text"
.Body = "Body text"
.Display
.Attachments.Add ThisWorkbook.FullName, Type:=olByReference
End With
End Sub

Thanks much for your assistance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default How to e-mail a shortcut to the active workbook

Maybe just sending the link:

Option Explicit
Public Sub SendFileLink()
Dim oOutlook As New Outlook.Application
Dim oMessage As Outlook.MailItem
Dim wReviewSheet As Excel.Worksheet
Set oMessage = oOutlook.CreateItem(olMailItem)
ThisWorkbook.Save
With oMessage
.Subject = "Subject text"
.Body = "Body text" & vbLf & _
"file://" & _
Application.Substitute(ThisWorkbook.FullName, " ", "%20")
.Display
End With
End Sub

But if that workbook is in a folder in my C: drive, won't it be quite a
coicidence that you have one in the same exact location?

(disregard if your workbook is on a network drive)

And changing the backslashes to slashes makes it look pretty (but both worked ok
in Outlook--although neither worked in Outlook Express.

With oMessage
.Subject = "Subject text"
.Body = "Body text" & vbLf & _
"file://" & _
Application.Substitute(Application.Substitute _
(ThisWorkbook.FullName, " ", "%20"), "\", "/")
.Display
End With

quartz wrote:

I am using Office 2003 with Windows XP.

Anyone know how to e-mail a shortcut to the currently active workbook?
I have tried using the following code, but this sends a copy of the file not
a LINK or SHORTCUT to the original file:

Public Sub SendFileLink()
Dim oOutlook As New Outlook.Application
Dim oMessage As Outlook.MailItem
Dim wReviewSheet As Excel.Worksheet
Set oMessage = oOutlook.CreateItem(olMailItem)
ThisWorkbook.Save
With oMessage
.Subject = "Subject text"
.Body = "Body text"
.Display
.Attachments.Add ThisWorkbook.FullName, Type:=olByReference
End With
End Sub

Thanks much for your assistance.


--

Dave Peterson
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
HOW TO COPY 480 ACTIVE E-MAIL ADDRESSES CLM "G" ON AN ACTIVE EXCE. ragman10 Excel Discussion (Misc queries) 1 December 13th 04 11:52 PM
email shortcut to active workbook as an outlook attachment Neil Deinhardt Excel Programming 0 September 28th 04 08:14 PM
how to send a workbook shortcut as attachement in an e-mail from a userform Valeria[_2_] Excel Programming 5 January 22nd 04 12:02 PM
Call macro from active workbook-duplicate shortcut keys James[_18_] Excel Programming 1 January 16th 04 05:53 PM
Shortcut to toggle active Worksheet m Shane Excel Programming 2 December 27th 03 09:15 PM


All times are GMT +1. The time now is 03:01 AM.

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

About Us

"It's about Microsoft Excel"