Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HOW TO COPY 480 ACTIVE E-MAIL ADDRESSES CLM "G" ON AN ACTIVE EXCE. | Excel Discussion (Misc queries) | |||
email shortcut to active workbook as an outlook attachment | Excel Programming | |||
how to send a workbook shortcut as attachement in an e-mail from a userform | Excel Programming | |||
Call macro from active workbook-duplicate shortcut keys | Excel Programming | |||
Shortcut to toggle active Worksheet | Excel Programming |