• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 462
  • Last Modified:

VBScript to add sender to Outlook Titlebar

Hello all,

I have a program on my computer that records the name and time of each active window on my computer.  I use this for time tracking/billing purposes.  The only thing that this program (or any other that I've found) doesn't do is record anything more that the subject of Emails.  This is because messages opened in Outlook have the Subject in the Titlebar, but that's it.

I've seen some references that it's possible to customize the Titlebar in Outlook, but can't find the details.  

Does anyone know how this might be accomplished?  It would save me tons of time when recording my hours.

I use Outlook 2010 in Win7 Ultimate.

Thanks,
-ChipConnJohn Add Sender to Titlebar
0
nieblertech
Asked:
nieblertech
  • 4
  • 3
1 Solution
 
Brian GeeCommented:
The title bar in an Outlook item like you have above is predicated by the subject line. You could change the subject line from a draft AND already received email as well. If you like, try opening an email you have already received, click into the subject line (make sure you see the text select I-beam when you click and not the white arrow) and then type. Start typing and you'll see you're editing the subject line. After you're done, de-select out of the subject line (click into the body of the email) and you'll see that the title bar updates accordingly. Just save and you're done (if you don't save, you will be prompted to do so once you close the email itself).
0
 
Brian GeeCommented:
See the first picture... I've edited the subject line by clicking into the Subject line and then start typing a message to you:

 Before update of titlebar from subject line
After clicking into the body of the email (to de-select from the Subject line), look how the titlebar changed. Click the Save button to solidify this change.

 After update of titlebar from subject line
0
 
nieblertechAuthor Commented:
Hi yobri,

Thanks for your thoughts on a fix, but that would get really hard to manage.  I would really like an automated solution.  I know that modifying the content of the Titlebar was possible back in Office 2000 because I saw a post about it.  Unfortunately no details were given in the post as to how to do it.  Unless MS took the functionality out of later versions of Office it should be possible though.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
Brian GeeCommented:
I can get you some VBA code to more easily edit the Subject line of your email(s) if you were interested in that (which would change the titlebar accordingly). Let me know if you think this kind of solution might be acceptable to you.
0
 
nieblertechAuthor Commented:
Problem with that is most of the time tracking of emails is me replying to clients.  I'd prefer if only the Titlebar changed, but if you think that's not possible I suppose something like appending:

- from:<email@address.com>

to the end of the Subject line would work.

-John
0
 
Brian GeeCommented:
Unfortunately, I'm unsure of the process of editing Outlook message titlebars (if it's possible) only because they seem to be driven by the contents of the subject line.

But to address what you what you might accept as mentioned above, this VBA code could be used and placed into a button to make this process very easy.

Sub EmailAddressToEndSubjectLine()
    'Append email address to end of subject line (ee: nieblertech)
    'Email must be selected before running this
    
    Dim olkMsg As Object
    
    On Error Resume Next
    
    For Each olkMsg In Application.ActiveExplorer.Selection
        If olkMsg.Class = olMail Then
            olkMsg.Subject = olkMsg.Subject & " - from: " & olkMsg.SenderEmailAddress
            olkMsg.Save
            
            Set olkMsg = Nothing
            MsgBox "Complete"
        End If
    Next

End Sub

Open in new window


This code can be run from the Inbox (with an email selected in the view) or on an email that is already opened in front of you.

Let me know if you need help making this a button on your Outlook toolbar.
0
 
nieblertechAuthor Commented:
Worked well for what is written.  I actually had a freelancer.com coder write some scripts.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now