VBScript to add sender to Outlook Titlebar

Posted on 2011-04-25
Last Modified: 2012-05-11
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.

-ChipConnJohn Add Sender to Titlebar
Question by:nieblertech
    LVL 23

    Expert Comment

    by:Brian Gee
    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).
    LVL 23

    Expert Comment

    by:Brian Gee
    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

    Author Comment

    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.
    LVL 23

    Expert Comment

    by:Brian Gee
    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.

    Author Comment

    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:<>

    to the end of the Subject line would work.

    LVL 23

    Accepted Solution

    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
                Set olkMsg = Nothing
                MsgBox "Complete"
            End If
    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.

    Author Closing Comment

    Worked well for what is written.  I actually had a coder write some scripts.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Learn more about the importance of email disclaimers with our top 10 email disclaimer DOs and DON’Ts.
    Use email signature images to promote corporate certifications and industry awards.
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now