Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forward a mail item from inbox after adding some text

Status
Not open for further replies.

HelpUs

Programmer
Sep 4, 2003
7
US
Hi,

I am a moderator for the Distribution list (DL). I do receive lots of mail daily to distribute various DLs. Before I forward the message I add text on the top not to reply me and to contact the person who has signed the mail (or the mail address extract from the original message).

My requirement is to add few custom buttons on my standard tool bar depending upon the mail I click on the button and it will do all the task, i.e add the text, put the right DL address to forward the mail and send it and file it to the right folder from the sent item folder.

The mails come either in HTML format or in RTF format. I tried below code

Set objOutlook = CreateObject("Outlook.Application")
Set objInspector = objOutlook.ActiveInspector

' Check and see if anything is open.
If Not objInspector Is Nothing Then
' Get the current item.
Set objItem = objInspector.CurrentItem

' Get the current date and time.
strDateTime = Now()
objItem.Body = strDateTime & objItem.Body
End if

The above code has two drawbacks,

1. I need to open the mail either clicking the forward button or by double click the mail.
2. It changes the format of the mail. (i.e. looses all color settings in RTF, html codes visible etc)

As I have set to see mails in “View Pane” I can see the mails by clicking the mail list and can decide which button I need to press.

Thanks
 
Have you tried to play with the .HTMLBody property instead of .Body ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top