A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

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



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 3rd 08, 09:02 PM posted to microsoft.public.outlook.program_vba
Ryan Arnold
external usenet poster
 
Posts: 1
Default Macro to rename Subject of E-mail on exchange server(2007)

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.
Ads
  #2  
Old October 3rd 08, 10:48 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default Macro to rename Subject of E-mail on exchange server(2007)

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

On Oct 3, 3:02*pm, Ryan Arnold Ryan
wrote:
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.


  #3  
Old October 4th 08, 12:07 AM posted to microsoft.public.outlook.program_vba
Ryan Arnold[_2_]
external usenet poster
 
Posts: 2
Default Macro to rename Subject of E-mail on exchange server(2007)

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?

"JP" wrote:

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

On Oct 3, 3:02 pm, Ryan Arnold Ryan
wrote:
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.



  #4  
Old October 4th 08, 12:40 AM posted to microsoft.public.outlook.program_vba
Ryan Arnold[_2_]
external usenet poster
 
Posts: 2
Default Macro to rename Subject of E-mail on exchange server(2007)

I found it, SendKeys command, thanks again!

"Ryan Arnold" wrote:

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?

"JP" wrote:

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

On Oct 3, 3:02 pm, Ryan Arnold Ryan
wrote:
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.



  #5  
Old October 6th 08, 04:30 AM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default Macro to rename Subject of E-mail on exchange server(2007)

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

On Oct 3, 6:07*pm, Ryan Arnold
wrote:
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?

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Mail delivery location with Exchange Server Outlook 2007 LarryInLima Outlook - Installation 7 February 12th 08 03:40 PM
No incoming mail on Outlook Client - Mail server Exchange/Acitve Directory [email protected] Outlook - General Queries 4 August 3rd 06 12:45 PM
Macro to change the outgoing mail server TeeJii Outlook and VBA 1 May 23rd 06 10:00 PM
Automatically trigger a VBA macro to run when connection to exchange server has been made. [email protected] Outlook and VBA 1 January 30th 06 11:29 PM
Automatically trigger a VBA macro to run when connection to exchange server has been made. [email protected] Outlook and VBA 0 January 25th 06 09:52 PM


All times are GMT +1. The time now is 04:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.