![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#2
|
||||
|
||||
|
I don't propose to work through & debug 300+ lines of code.
What you could do is something like: Code:
For Each para In myRange.Paragraphs
If para.Style = "Distribution List Name" Then
'Remove paragraph break & clean up name by deleting anything after a comma,
'which indicates a managing committee member or a job title.
strDistName = Trim(Split(Split(para.Range.Text, vbCr)(0), ",")(0))
If strDistName <> "" Then
intNameCount = intNameCount + 1
Call UpdateProgress(intNameCount)
Select Case strDistName
Case "Federal Reserve Board", "Office of the Comptroller of the Currency", "Ernst & Young LLP", "Central Bank of Ireland"
Case "Narayan Subramaniam" 'resolves to NarayanSubramaniamDirects@usbank.com
strTransmittalList = strTransmittalList & vbCr & "NarayanSubramaniamDirects@usbank.com" & ";"
Case "Mazars" 'resolves to Mazarsdata@usbank.onmicrosoft.com
strTransmittalList = strTransmittalList & vbCr & "Mazarsdata@usbank.onmicrosoft.com" & ";"
Case "David Wright"
strTransmittalList = strTransmittalList & vbCr & "hard-coded email address" & ";" 'Insert hard-coded email address here
Case "Peter Gaertner"
strTransmittalList = strTransmittalList & vbCr & "hard-coded email address" & ";" 'Insert hard-coded email address here
Case Else
'Attempt to resolve
......
End Select
Code:
For Each k In Dict_People.Keys
If Dict_People(k) > 0 Then
strPerson = k
Select Case strPerson
Case "David Wright", "Peter Gaertner"
Case Else: strExceptions = strExceptions & strPerson & vbCr
End Select
Else
'Ok
End If
Next k
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bypass VBA macro password in Excel | daniel.smith.10 | Excel Programming | 2 | 07-11-2017 01:58 AM |
| how to enter information to outline code column | ketanco | Project | 3 | 02-04-2015 03:07 PM |
Merge not Displaying as Coded
|
Dmo | Mail Merge | 5 | 07-24-2014 03:24 PM |
| writing task logic and task information box | ketanco | Project | 1 | 06-15-2014 09:02 AM |
| Retrieving Microsoft Outlook 2007 information after formatted hard disk (C drive) | SWEngineer | Outlook | 0 | 09-23-2012 01:47 AM |