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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Coding in Outlook questions

Status
Not open for further replies.

dmkAlex

Programmer
Nov 25, 2005
66
US
I am proficient in vba (primarily in Excel) and vb6 but never done any coding in Outlook.

I need some help to get me started. Here's what I want to do:

I have the preview option/window open in my outlook, when I highlight the message in the inbox, I can see most of the content in the preview box. I want to have the ability to response (reply) to the highlighted message by clicking on an icon on the toolbar (I know how to create the icon, but I need help in the macro).

Can someone get me started with the basic?

Thanks.

Alex
 
I am playing around with it and get to the point I am able to reply emails.

The problem I am encountering is: the original mail was in HTML format. My objective is to reply the message with my answer on the top part of the body and the rest of the body would contain the original email, including the html format. But I am not able to retain the html format in the reply message. It somehow converted all the html appearance into html code.

Can someone tell me what I've done wrong?

Here is my code:

Dim myOlApp As New Outlook.Application
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection
Dim MsgTxt As String
Dim x As Integer
Set myOlSel = myOlExp.Selection

myOlSel.Item(1).BodyFormat = olFormatHTML
myOlSel.Item(1).HTMLBody = "<html><p>This is my reply</p>" & myOlSel.Item(1).Body & "</html>"


myOlSel.Item(1).Display


-----------------------------------------
Thanks.

Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top