Hey guys,
How do I catch the Reply to Email event? I used the following code to convert the email to HTML, but I want it to run automatically so I dont have to run the macro on demand when I need to convert to HMTL.
Code:Sub ReplyInHTML() Dim objItem As Object Dim objReply As MailItem Set objItem = GetCurrentItem() If Not (objItem Is Nothing) Then objItem.HTMLBody = Replace(objItem.Body, vbCrLf, "<br>") Set objReply = objItem.Reply objReply.Display End If Set objItem = Nothing Set objReply = Nothing End Sub
Thanks!
There are at least two ways I can think of doing this. Here is a method that checks the the email to hit the sent items folder.
I also think that you could also fire an event when the inspector (this is the window that is open for the mail) closes because an email was sent. I do not have code for that one.Code:Private WithEvents olkFolder As Outlook.Items Private Sub Application_Quit() Set olkFolder = Nothing End Sub Private Sub Application_Startup() Set olkFolder = Outlook.Session.GetDefaultFolder(olFolderSentMail).Items End Sub Private Sub olkFolder_ItemAdd(ByVal Item As Object) 'Change the subroutine names to match your subroutine name' MySubroutine End Sub Private Sub MySubroutine(olkItem As Object) 'Your code goes here' End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks