Quantcast
Channel: Office 2013 and Office 365 ProPlus - Planning, Deployment, and Compatibility forum
Viewing all articles
Browse latest Browse all 3748

Manipulating subject in mail using VBA

$
0
0

Hi,

I have the need for a VBA code for Outlook, that will take the subject line, identify a casenumber XXXX123456, and put [] on the casenumber. For example:

Subjectline: Printerproblems XXXX123456

Subjectline: Printerproblems [XXXX123456]

(The casenumber can be anywhere in the subject line.)

 Dim strSubject As String
 strSubject = Item.Subject
 strSubject = Replace(strSubject, "XXXX", "[XXXX")
 Item.Subject = strSubject

But I can not find a way to write the last ]. Maybe I am doing this wrong, or something smarter exist.

Please help.

Best regards,

Mr. T


Viewing all articles
Browse latest Browse all 3748

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>