Quote Originally Posted by pebcak View Post
Thank you so much for your response ... I suppose the searching part is a bit more ambitious than I anticipated.

What about a macro that just searches the subject field of the currently selected email to find the UID and copy that into the clipboard?

The UID always follows the format of four numbers a hyphen and six numbers. The first four numbers are a year, the last six numbers are a serial number. So it's safe to say the first two numbers of the year will always start with a 20 and the first number of the serial will start with a 0, e.g., 20##-0#####. Case numbers look like 2019-012345, 2020-029415 and 2021-000325.

OK so I've almost got it to set a string as the subject line.

Sub FindMatterNumber ()

Dim strSubject as String
Dim myItem as Outlook.MailItem

strSubject = myItem.Subject

MsgBox "Subject is: " & strSubject

End Sub


But it's breaking on the strSubect = my item.Subject ... I don't know how to identify the Subject