VBA Outlook : Subject line : Cut and Paste name to heading , number to very end of the body of Email

Not open for further replies.


New Member
Outlook version
Outlook 2016 64 bit
Email Account
Exchange Server 2007
I have many emails in outlook that I need to cut the numbers "1234" from subject line and paste to very end of body of email, and cut the name "Dennis," to the heading in the body of email. There will always be 4 spaces in between the comma and the first number. Please help, thank you.

Ex) Subject Line: Dennis, 1234

Body of email
xxxx xxxx xxx xxxx
Thank you for your interest. 1234

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
You'd use instr or regex. This sample will give you an idea of how to do it - Create Appointment From Email Automatically

You'd do something like this to use the values in the message body:

strName = apptArray(0) & "," & vbcrlf
StrCode = apptArray(1)
With objMail
.Body = strName & Item.Body & strCode
' .Send
End With
Not open for further replies.