Autopopulate Email Subject from Project

Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
When a user opens up a new email from within a Project, it autopopulates the "To:" field with all the linked accounts/contacts that are attached to the project.

How can I get it to also autopopulate the subject of the Project in the "Subject" field? I am fairly-to-moderately familiar with VBA (mostly worked in Excel) and wouldn't mind coming up with a macro to do this, but I'm very new at messing with VBA in BCM. Anyone have any suggestions?
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
I'm not famliar with BCM, however, this should work: The Newinspector event is triggered when a new item opens. In that event check Application.ActiveWindow, if it's an Explorer, ActiveExplorer.Selection(1) gives you a ref on the selected item. If it's an Inspector, Activeinspector.CurrentItem will do it. Once you have that reference, read it's Subject property.
 
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
I was able to get it to populate the subject line, but unfortunately when I do that the associated contacts disappear and no longer populate the "To:" field. Oh well.
 
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
I'm using a slightly modified version of this example from Microsoft (mine sends an automated email when the notes for a project or task are updated instead of when the status changes). I just added this to ThisOutlookSession after declaring oTaskItem outside all of the other stuff:

Public Sub CreateNewMessage()
Dim objMsg As MailItem
Set objMsg = Application.CreateItem(olMailItem)
With objMsg
.Subject = oTaskItem.Subject
.Display
End With
Set objMsg = Nothing
End Sub​
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Try the suggested approach, that is Outlook creates the email, and you just change the subject.
 
Top