At work we use a program that when clicking an email address, it creates a blank email in outlook 2007 with the recipients email address in all caps like this:
MARCUS JAMES (marcusjames44@domain.com)
and so for every email i send i manually change the case in their name. Is there a macro that could do that for me? I realize it won't be perfect because of some types of names and titles etc, but i can deal with the occasional mis-capitalized name.
Hi marcusjb,
I don't find a Proper Case function in Outlook but do find a routine that may help at
http://www.utteraccess.com/forum/Con....html&p=781258
One test is worth a thousand opinions.
Click the * below to say thanks.
Seems complicated. I'm not really sure what to do with functions.
Assuming that when an email is created it remains displayed in a window, try...
It should deal with one or more recipients, and in varying formats, such as the following...Option Explicit Sub test() Dim objOutlook As Outlook.Application Dim objInspector As Outlook.Inspector Dim objMailItem As Outlook.MailItem Dim i As Integer Dim v As Variant Dim x As Variant Dim y As String Dim strRecipients As String Set objOutlook = GetObject(, "Outlook.Application") For Each objInspector In Outlook.Inspectors Set objMailItem = objInspector.CurrentItem With objMailItem If .To <> "" Then v = Split(.To & ";", ";") For i = LBound(v) To UBound(v) If v(i) <> "" Then If InStr(1, v(i), "(") > 0 Then x = Split(v(i), "(") y = WorksheetFunction.Proper(LTrim(x(0))) & "(" & x(1) strRecipients = strRecipients & y & "; " Else strRecipients = strRecipients & LTrim(v(i)) & "; " End If End If Next i .To = strRecipients strRecipients = "" End If End With Next objInspector End Sub
JOHN SMITH (johnsmith@xyz.com) =====> John Smith (johnsmith@xyz.com)
JOHN SMITH (johnsmith@xyz.com); jane doe; joe@abc.com; JOE BLACK (joeblack@xyz.com) =====> John Smith (johnsmith@xyz.com); jane doe; joe@abc.com; Joe Black (joeblack@xyz.com)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks