Reply to Name in Outlook Email Body

I am not sure if this is possible or not. Our helpdesk will send us plain text emails that come from a generic account. The sixth line of every email has the employee's name in it.

I am looking for a way for me to either reply to the helpdesk email and have the employee's name entered or maybe a way (like a quick step) that will forward the email and paste in the employees name. Either way, their name will auto complete.

The admin who runs the helpdesk won't even consider adding in an email field, using ldap queries, etc...

Any help with this would be wonderful!
LVL 22
Joseph MoodyBlogger and wearer of all hats.Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
KimputerConnect With a Mentor Commented:
with alt+f11 add this code:

Sub MailItemContent()
    Dim olItem As Outlook.MailItem
    Dim sText As String

    Set olItem = ActiveExplorer.Selection.Item(1)
    sText = olItem.Body
    Lines = Split(sText, vbCrLf)
    
    Set myOutlook = Outlook.Application
    Set objMailMessage = myOutlook.CreateItem(0)
        With objMailMessage
            .To = Lines(5)
            .Subject = "Email subject"
            .Body = "Email body." 'Msg + Signature?
            .Display
        End With

End Sub

Open in new window


Usage: Select email item, run this code (alt+F8, or make a shortcut to this macro on your toolbar), voila, and open email with the To: field filled with the 6th line of that email.
You can easily see what to adjust (subject, email body) yourself to make it your own.
0
 
Joseph MoodyBlogger and wearer of all hats.Author Commented:
This is really cool!! Is there a way to grab only part of the 6th line?

The sixth line looks like: Opened By: FirstName LastName.

I would like to grab everything after the "Opened By: "

And thank you again!!
0
 
KimputerCommented:
Yes, find line 12 in previous code starting with .To =

replace with:

.To = Replace(Lines(5), "Opened By: ", "")

Open in new window

0
 
Joseph MoodyBlogger and wearer of all hats.Author Commented:
Thank you so much! You make this look so easy!
0
All Courses

From novice to tech pro — start learning today.