Oops. Didn't paste the whole thing in my last post. Here's the whole
thing, which appears to have the "End Function" you mentioned. Sorry for
the goof. Now what?
Sub ReplyInHTML()
Dim objItem As Object
Dim objReply As MailItem
Set objItem = GetCurrentItem()
If objItem.GetInspector.EditorType <> olEditorHTML Then
' Outlook 2002 can substitute the next statement
' for the above If statement
'If objItem.BodyFormat <> olFormatHTML Then
objItem.HTMLBody = Replace(objItem.Body, vbCrLf, "<br>")
End If
Set objReply = objItem.Reply
objReply.Display
Set objItem = Nothing
Set objReply = Nothing
End Sub
Function GetCurrentItem() As Object
Dim objApp As Application
Set objApp = CreateObject("Outlook.Application")
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
End Select
Set objApp = Nothing
End Function
You apparently didn't include the entire GetCurrentItem() function, which
should end with the statement "End Function."
It always makes me nervous when people start messing with VBA without
understanding even the basics. You might want to do a little background
reading, starting at
http://www.slipstick.com/dev/vb.htm#tutorials.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at
http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers