Need to find all instances of parentheses within a Word doc that have 2 or more characters within the parens.
"but wait - there's more!"
Need to make sure it doesn't pick up a sentence within parens, I'm hoping there's a way to enforce that at least 2 of the characters are in ALL CAPS consecutively)
If we say: just make sure there are at least 2 All Caps it could still pick up something like: (Computer Equipment) (not good)
Ultimately, I'm trying to extract all Acronyms (AND THEIR MEANINGS) from a Word doc.
I've found many posts that extract full all caps words - but don't want that...
Need the parens finder in place to narrow it down to hopefully just the acronyms and not other words in all caps and not other words in parens like "Computer Equipment".
The documents I'm working with are very strict in having the meaning of the acronym placed PRIOR to the acronym so my thought is -- if we can extract the full sentence preceding the parens that holds at least 2 consecutive all caps -- then, we'll be able to capture the meanings!
(Yes, probably a bit of other garb too) -- but I'm probably living a pipe dream if I think the VBA code can evaluate the acronym and then pull the "x" number of words preceding it that correspond... Hopefully, someone can tell me it's not a pipe dream at'all!?
Example:
*Course of Action (COA) - would pick up 3 preceding words since the acronym has 3 chars
*Total Case Incidence Rate (TCIR) - would pick up 4 preceding words since the acronym has 4 chars
*Accountable Property System of Record (APSR) - this is where it gets tricky (see the next one too)
*Service Development and Delivery Process (SDDP) - would pick up 5 preceding words because it sensed that it needed 5 words that started with a capital letter...so when it encountered the word "and" - it kept going left until it knew it had extracted 5 words that started with a capital letter (and) how ever many in between words as necessary..
Keep in mind, sometimes the acronyms might contain a NON-ALL CAP letter or a special character)
*Packaging, Transportation, and Regulated Material (PT&RM)
*Department of Defense (DoD)
If it's smart enough to accomplish that -- then I'll be doin' a major happy dance...
How ever close we can get -- would be greatly appreciated...
If it's just picking up a full sentence where ALL CAPS within PARENS exist together -- that's great...
Oh! The results can be placed into another new empty Word doc - or into an Excel file, whatever is easiest..
The code can assume the active Word doc is open when "Run" is clicked..
"but wait - there's more!"
Need to make sure it doesn't pick up a sentence within parens, I'm hoping there's a way to enforce that at least 2 of the characters are in ALL CAPS consecutively)
If we say: just make sure there are at least 2 All Caps it could still pick up something like: (Computer Equipment) (not good)
Ultimately, I'm trying to extract all Acronyms (AND THEIR MEANINGS) from a Word doc.
I've found many posts that extract full all caps words - but don't want that...
Need the parens finder in place to narrow it down to hopefully just the acronyms and not other words in all caps and not other words in parens like "Computer Equipment".
The documents I'm working with are very strict in having the meaning of the acronym placed PRIOR to the acronym so my thought is -- if we can extract the full sentence preceding the parens that holds at least 2 consecutive all caps -- then, we'll be able to capture the meanings!
(Yes, probably a bit of other garb too) -- but I'm probably living a pipe dream if I think the VBA code can evaluate the acronym and then pull the "x" number of words preceding it that correspond... Hopefully, someone can tell me it's not a pipe dream at'all!?
Example:
*Course of Action (COA) - would pick up 3 preceding words since the acronym has 3 chars
*Total Case Incidence Rate (TCIR) - would pick up 4 preceding words since the acronym has 4 chars
*Accountable Property System of Record (APSR) - this is where it gets tricky (see the next one too)
*Service Development and Delivery Process (SDDP) - would pick up 5 preceding words because it sensed that it needed 5 words that started with a capital letter...so when it encountered the word "and" - it kept going left until it knew it had extracted 5 words that started with a capital letter (and) how ever many in between words as necessary..
Keep in mind, sometimes the acronyms might contain a NON-ALL CAP letter or a special character)
*Packaging, Transportation, and Regulated Material (PT&RM)
*Department of Defense (DoD)
If it's smart enough to accomplish that -- then I'll be doin' a major happy dance...
How ever close we can get -- would be greatly appreciated...
If it's just picking up a full sentence where ALL CAPS within PARENS exist together -- that's great...
Oh! The results can be placed into another new empty Word doc - or into an Excel file, whatever is easiest..
The code can assume the active Word doc is open when "Run" is clicked..