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

  • Thread starter Thread starter Ryan Arnold
  • Start date Start date
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.
 
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
 
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?
 
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?
 
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
 
Back
Top