MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 30th, 2004, 03:45 PM   #1
Wook
 
Join Date: Apr 2003
Posts: 75
Default Is Emailing a shortcut to a file possible in vba?

Hi all,
Anyone know how to email a shortcut to a file, I know attacting a whole file is fairly easy, but attaching a shortcut...?

ta Wook
Wook is offline   Reply With Quote
Old Mar 30th, 2004, 04:17 PM   #2
Davers
 
Davers's Avatar
 
Join Date: Sep 2002
Location: Michigan
Posts: 1,132
Default Re: Is Emailing a shortcut to a file possible in vba?

Hello...I think this will do it...

Code:
Dave

P.S. This was taken directly from Outlook's help file...they give a list of all the different things you can link...
__________________
Using Windows XP with Office XP
Davers is offline   Reply With Quote
Old Mar 30th, 2004, 04:20 PM   #3
Davers
 
Davers's Avatar
 
Join Date: Sep 2002
Location: Michigan
Posts: 1,132
Default Re: Is Emailing a shortcut to a file possible in vba?

And after re-reading...did I mis-understand your question? You would just type the address as I've shown above into the body of the e-mail...did you want to do that through code?

Sorry if I mis-understood,

Dave
__________________
Using Windows XP with Office XP
Davers is offline   Reply With Quote
Old Mar 31st, 2004, 11:56 AM   #4
Wook
 
Join Date: Apr 2003
Posts: 75
Default Re: Is Emailing a shortcut to a file possible in vba?

Hi Davers, sorry for the late reply.

Sorry I don't think I explained myself very well.

I need something like the below - which when run in excel creates a email and attaches a file. But instead of attaching a file I need to attach a shortcut file pointing to its location - actual file too big to email!

Any thoughts?

Set olookApp = CreateObject("Outlook.Application")
Set mailnewmail = olookApp.CreateItem(olMailItem)
Set myAttachment = mailnewmail.Attachments
With mailnewmail
.To = "Address"
.Subject = ActiveWorkbook.Name
.Display
End With
myAttachment.Add FilePath & "\" & FileName & ".xls"
Wook is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 09:31 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.