|
Hey Ladies and Gents,
I am a bit new to the world of visual basic so please be kind.
I have been set a mini-project here at work and need some assistance. What i am trying to achieve is for a user to click a command button in excel, opening up a new mail message in outlook. This new mail message will include filled areas in to, subject and main body with a hyperlink to the document in which they have just updated.
I have managed to produce the following code so far:
Sub Button1_Click()
Dim theApp, theNameSpace, theMailItem, myAttachment, MessageBody, subject
'create a new Outlook Application Object, 'direct it to the proper NameSpace, 'create a new Mail Item and set the attachments collection
Set theApp = CreateObject("Outlook.Application") Set theNameSpace = theApp.GetNamespace("MAPI") Set theMailItem = theApp.CreateItem(0) theMailItem.Display Set myAttachment = theMailItem.Attachments MessageBody = "Please note the following file has now been updated {First Name Surname}" subject = "subject information" 'add recipients to MailItem
theMailItem.Recipients.Add ("user@company.co.uk") theMailItem.subject = subject theMailItem.Body = MessageBody
End Sub
I need some help with the body format e.g. paragraphs and what/how do i need to implement a hyperlink in the body of the email
Hopefully some of you can help
Thanks
Richard |