Alc
10-23-2007, 07:34 AM
I'm using the following to create an email and attach a report to it (str_body, str_recipient and lb_readreceipt are set elsewhere).
Set objOutlook = CreateObject("Outlook.Application")
Set ObjOutlookMsg = objOutlook.CreateItem(olMailItem)
With ObjOutlookMsg
Set objoutlookattach = .Attachments.Add(str_New_File)
.To = str_Recipient
.Subject = str_Subject
.Body = str_Body
.readreceiptrequested = lb_ReadReceipt
.Display 'to display the message instead of sending it
End With
This works fine, but now my manager wants to add various other bits and pieces to it. I can't find an example to base my work on, so does anyone know how I could easily amend the above to do any of the following?
1) Insert a hyperlink to a website.Ideally, without displaying the entire address (e.g. display 'google' but open www.google.com, when clicked)
2) Insert a hyperlink to an email address
3) Highlight certain words in the str_Body string (e.g. highlight some in yellow, some in green, etc.)
I've tried recording a macro in Outlook and stepping into it, to copy the code, but I'm not having the same success I have when doing that with Excel.
Thanks in advance for any suggestions.
Set objOutlook = CreateObject("Outlook.Application")
Set ObjOutlookMsg = objOutlook.CreateItem(olMailItem)
With ObjOutlookMsg
Set objoutlookattach = .Attachments.Add(str_New_File)
.To = str_Recipient
.Subject = str_Subject
.Body = str_Body
.readreceiptrequested = lb_ReadReceipt
.Display 'to display the message instead of sending it
End With
This works fine, but now my manager wants to add various other bits and pieces to it. I can't find an example to base my work on, so does anyone know how I could easily amend the above to do any of the following?
1) Insert a hyperlink to a website.Ideally, without displaying the entire address (e.g. display 'google' but open www.google.com, when clicked)
2) Insert a hyperlink to an email address
3) Highlight certain words in the str_Body string (e.g. highlight some in yellow, some in green, etc.)
I've tried recording a macro in Outlook and stepping into it, to copy the code, but I'm not having the same success I have when doing that with Excel.
Thanks in advance for any suggestions.