Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Mar 2004
    Location
    London, Gtr London, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    counting recipients of email (Outlook 2003)

    Is there a quick way to count the number of email addresses in the To: Cc: and Bcc: fields of an Outlook email?
    I often need to pick names from a list, and would like a simple way to check that I have not missed one, or added too many names
    (duplicates are ignored I understand). Any help welcome - I can cope with simple macro/vba code if that's what it takes if you send an example.
    Thanks

  2. #2
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: counting recipients of email (Outlook 2003)

    Hiya.

    If you use this code

    <pre>Public Sub countNames()
    Dim m As MailItem, strNames As String, i As Integer, j As Integer
    Set m = ActiveInspector.CurrentItem
    j = 1
    strNames = m.To
    If Not (Len(m.CC) = 0) Then
    strNames = strNames & " ; " & m.CC
    End If
    If Not (Len(m.BCC) = 0) Then
    strNames = strNames & " ; " & m.BCC
    End If
    For i = 1 To Len(strNames)
    If Mid(strNames, i, 1) = ";" Then j = j + 1
    Next i
    MsgBox "There are " & j & " recipients in this mail"
    Set m = Nothing
    End Sub
    </pre>


    and assign a toolbar button in the message window to the macro 'countnames' then it should do the trick...
    Thanks,

    pmatz

  3. #3
    3 Star Lounger
    Join Date
    Mar 2004
    Location
    London, Gtr London, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: counting recipients of email (Outlook 2003)

    Thanks
    I shall give that a go over the weekend
    Frank

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: counting recipients of email (Outlook 2003)

    <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29> Wouldn't

    Sub AddressCount()
    If Inspectors.Count Then _
    Msgbox Activeinspector.CurrentItem.Recipients.Count + 1 & " addresses"
    ' add 1 for the sender - AFAIK there can only be one sender
    End Sub

    be simpler? On a -very- brief test it appears to count all recipients, including CC and BCC.
    -John ... I float in liquid gardens
    UTC -7ąDS

  5. #5
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: counting recipients of email (Outlook 2003)

    <img src=/S/salute.gif border=0 alt=salute width=15 height=20> much better indeed. I continue on my learning curve [img]/forums/images/smilies/wink.gif[/img]
    Thanks,

    pmatz

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: counting recipients of email (Outlook 2003)

    It's always possible that I overlooked something ... <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    -John ... I float in liquid gardens
    UTC -7ąDS

  7. #7
    3 Star Lounger
    Join Date
    Mar 2004
    Location
    London, Gtr London, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: counting recipients of email (Outlook 2003)

    Good work - the simpler the better!
    I shall try this way also

  8. #8
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: counting recipients of email (Outlook 2003)

    Frank, reading your reply and then re-reading your original post, I wondered if you might benefit from Distribution Lists. A Distribution List is a grouping of individual Contacts, or Addresses from another Address List such as the Global Address List in a Server, into a group such as "Sales", "Accounting", "Senior Management", Western Region", "Football Pool", etc.

    For more on Distribution Lists see Outlook Help.
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •