how to send a workbook shortcut as attachement in an e-mail from a userform

  • Thread starter Thread starter Valeria
  • Start date Start date
V

Valeria

Dear experts,
I am working on a userform and I would like to put in
there a label - when the user clicks on it, an e-mail
message opens that has as an attachment the shortcut to a
certain workbook on a server.
The "to" field should be populated but the user should
have the possibility to change the names if he/she wants
to. Also the subject line should populated. There should
also be a little message in the body of the e-mail.

I do not know how to achieve this - could you please help
me?
Many thanks in advance!
Best regards,
Valeria
 
Hi Ron,
I have tried this but I still have problems: VBA claims it
can't find the file I want to attach. Actually the file I
want to attach is a shortcut to a file (I have created the
shortcut in the folder), might this be the problem?
Otherwise I am sure the path to the file is OK.

Many thanks in advance!
Best regards,
Valeria


Private Sub Label3_Click()

Application.OnKey "^{F11}", "Show_Userform"
'You must add a reference to the Microsoft outlook Library

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "bla bla bla"
.Body = "bla bla bla"
.Attachments.Add ("\\server\Shortcut to my
file.xls")
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing

Me.Hide
End Sub
-----Original Message-----
Hi Valeria

Try one of the examples on my SendMail page.
Post back if you need more help
http://www.rondebruin.nl/sendmail.htm


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)




"Valeria" <[email protected]> wrote in
message news:[email protected]...
 
Hi Ron,
because the e-mail would then have attached the file and
not the shortcut - I want people to update the file
directly on the server and not on their computer! Plus as
4 different people need to update it, if they do not work
on the same file they risk to make changes, and then save
the file to the folder again deleting the changes made by
somebody else.
Do you have any ideas how to do this?
Many thanks,
Valeria

-----Original Message-----
Why not fill in the real path to the file ??

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)




"Valeria" <[email protected]> wrote in
message news:[email protected]...
 
Back
Top