Outlook 2007+ Changing signature also changes subject?

Status
Not open for further replies.

X82

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
I'm hoping someone can help.

Currently I use a series of signatures to reply to emails. New rules have come in at work, meaning that instead of the subject reading "RE: Info" or "RE: RE: RE:" I must change it to a pre-set sentence like Authorisation 0054213 . The number will change but the first part is always the same. Is there a way of making outlook change the subject line in the email, when I change the signature?

Even better, would be a script to take a 9 digit code in the body of the email which my signature currently produces and inserts that into the subject also. Can any of this be done?
 

Forum Admin

Senior Member
Signature question: no, you can't change the signature and subject at once.

You can use VBA to change the subject and can use it to pick up the number, if its easily parsed, i.e., is always in the body as "Auth code 123456789" or something like that that can easily be searched for.

Parsing text fields in Outlook - Slipstick Systems

Add a file number or keyword to the subject line of messages - Slipstick Systems - this is a VBA sample that you'd run on the message. You could also use an "ItemSend" macro to add the code as the message is sent.
 

X82

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Perhaps, is there a way instead, of having a drop down menu. I can chose from a pre-set list of subjects and chose one to send to clients? Can this be done instead? So I hit reply to all, chose a new subject and chose my signature and send. This would be easier than the current system in place. This possible?
 

X82

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Wow thats very kind of you. I shall look forward to it!
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
it's quick and dirty - a more complicated custom dialog would be better, but this is faster. Enter the desired subjects in the case statements - if you want to keep the original subject, use this format: oMail.Subject = "Code1 " & objItem.Subject

In Outlook 2013, signature switching doesn't work for plain text. That's where you click on a signature and choose a different one. Changing the account via code doesn't change the signature, you'll need to change it yourself.

It uses the getcurrentitem function at Outlook VBA: work with open item or selected item - Slipstick Systems so it works on open or selected messages.

Code:
Public Sub New_Reply() 
 
Dim objItem As Object 
 
Dim oMail As Outlook.MailItem 
 
Dim oAccount As Outlook.Account 
 
Dim strbox 
 
Set objItem = GetCurrentItem()
   Set oMail = Application.ActiveExplorer.Selection(1).Reply 
 
oMail.Display 
 
strbox = InputBox("Enter the subject - 1:Code1; 2:Code2; default is unknown", "Subject", "") 
 
Select Case LCase(strbox)
   Case "1"
       oMail.Subject = "Code1"
   Case "2"
      oMail.Subject = "Code2"
   Case Else
      oMail.Subject = "Unknown" 
 
End Select
  
 
End Sub
 

X82

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Thanks for this. sorry to be a pain, but I'm not quite sure how to implement this.

I open vba and paste this in a module? Then run it as a macro? Sorry to be a pain.
 

X82

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Apologies. I couldn't find an edit post button.

Managed to get it to work and it works great. Only thing I would say, would it be possible instead of a press 1,2 or 3, there would be a drop down menu which would appear?
 

X82

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Thats fantastic. Just what I needed!
 
Status
Not open for further replies.
Top