Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default email shortcut to active workbook as an outlook attachment

I work on a network with clients that are all running Windows NT4 and
Excel 97, but with a mix of Outlook 98 and 2000 (don't ask...). I'm
trying to develop a VBA procedure that runs from a command button in
an Excel workbook template. I would like the procedure to save and
email a shortcut to the active workbook (which resides on a file
server). So far, my attempts have failed miserably. I can get the
procedure to work by sending the actual file, but I cannot get it to
send a shortcut - the shortcut appears in the mail message at furst,
but disappears after it is sent.

The code I am using is as below:

Public Sub SendLink()
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 line text"
.Body = "Email body text"
.Display
.Attachments.Add ThisWorkbook.FullName, olByReference
End With
End Sub

As I have the Outlook 2000 email client, I have added the reference
for the Outlook 9.0 library.

The problem seems to relate to the olByReference property of the Add
method. If I use olByValue, the attachment is preserved after sending,
but is a copy of the actual file, not a shortcut.

The other thing I'm not sure of is whether this will work with clients
that have the Outlook 98 email client. I've added a reference to the
Outlook 9.0 library - will the other clients require access to the
Outlook 8.0 library?

Thanks in advance for any help on this issue,

Neil
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
Send active workbook as attachment via hyperlink Keith Thompson Excel Worksheet Functions 4 November 7th 13 03:53 PM
HOW TO PUT MORE THAN ONE WORKBOOK ATTACHMENT IN AN EMAIL? Traffic Coordinator Excel Discussion (Misc queries) 2 November 15th 05 09:37 PM
Excel Spreadsheet email attachment unable to open in Outlook Expr. Joanne from Tiffin, Oh Excel Discussion (Misc queries) 1 April 23rd 05 12:21 AM
Send active workbook as attachment OTTO Excel Programming 4 June 5th 04 10:06 AM
Email Attachment from Excel using Outlook. Pyball[_3_] Excel Programming 2 December 17th 03 07:08 PM


All times are GMT +1. The time now is 05:35 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"