Macro to rename Subject of E-mail on exchange server(2007)

R

Ryan Arnold

Hi all,

I work with many different people and we all use the same inbox, called
ServiceDesk. To keep more than one person from responding to an e-mail, we
usually put our initials in front of the subject of the e-mail. I was
wondering, can anyone point me to a macro that I could create that would
automatically insert initials in the subject line? Thanks in advanced.
 
J

JP

This should work on either a displayed or selected email:

Sub Insert_Initials()
'
'
Dim MyItem As Outlook.MailItem

On Error Resume Next
Select Case TypeName(Application.ActiveWindow)
Case "Explorer"
Set MyItem = ActiveExplorer.Selection.item(1)
Case "Inspector"
Set MyItem = ActiveInspector.CurrentItem
Case Else
End Select
On Error GoTo 0

If MyItem Is Nothing Then
GoTo ExitProc
End If

MyItem.Subject = "RA " & MyItem.Subject


ExitProc:
Set MyItem = Nothing

End Sub

--JP
 
R

Ryan Arnold

Thanks! If I wanted to save the message also, not on the hard drive, but have
the same function as ctrl+s, what could do that?
 
R

Ryan Arnold

I found it, SendKeys command, thanks again!

Ryan Arnold said:
Thanks! If I wanted to save the message also, not on the hard drive, but have
the same function as ctrl+s, what could do that?
 
J

JP

Sorry, I might have forgotten to include MyItem.Save in the code I
provided. Otherwise I don't think the code will actually do anything.

--JP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top