Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 04-16-2020, 06:43 AM
macropod's Avatar
macropod macropod is offline Abbreviations Validation - Word Windows 7 64bit Abbreviations Validation - Word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default



Quote:
Originally Posted by mrsandes View Post
if I were to find also abbreviations that are not enclosed by parenthesis, what else would I have to delete on the code?

I just removed the "\(" and "\)" on the search mechanism, but it gives me an error "Subscript out of range" and highlights the line:

Code:
StrAcronyms = StrAcronyms & Split(StrTmp, "|")(1) & vbTab & Split(StrTmp, "|")(0) & vbCr
Simply omitting the "\(" and "\)" is sufficient for the Find, but the highlighted line depends on the presence of '|' characters, which are inserted by the preceding line:
Code:
StrTmp = Replace(Replace(Replace(.Text, " (", "("), "(", "|"), ")", "")
In any event, that change is liable to result is far more false matches.
Quote:
Originally Posted by mrsandes View Post
Another thing that I noticed is that the AcronymManager macro will not replace the text in the document for the acronym if the text is not capitalized in each word... What I mean is, if I have the acronym Part List (PL) found and listed in the acronyms table, it will update in the document every instance that "Part List" is written, replacing by "PL", but it will not replace the instances where "part list" is written. Would it be possible to change that setting?
That's because it was assumed that strings such as 'parts list' might be intentional non-uses of the defined term. You can alter the behaviour by changing:
.MatchCase = True
to:
.MatchCase = False
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #17  
Old 04-16-2020, 07:36 AM
mrsandes mrsandes is offline Abbreviations Validation - Word Windows 10 Abbreviations Validation - Word Office 2019
Novice
Abbreviations Validation - Word
 
Join Date: Apr 2020
Posts: 10
mrsandes is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Simply omitting the "\(" and "\)" is sufficient for the Find, but the highlighted line depends on the presence of '|' characters, which are inserted by the preceding line:
Code:
StrTmp = Replace(Replace(Replace(.Text, " (", "("), "(", "|"), ")", "")
In any event, that change is liable to result is far more false matches.
So if I were to test the results with the search looking for all matches (without parenthesis), I would have to add the '|' characters to each of the found acronyms? That's what the replace line is doing, right?

Quote:
Originally Posted by macropod View Post
That's because it was assumed that strings such as 'parts list' might be intentional non-uses of the defined term. You can alter the behaviour by changing:
.MatchCase = True
to:
.MatchCase = False
That change has a side effect of replacing the first instance of the acronym to all uppercase letters definition, so the first instance looks like: PARTS LIST (PL). Would you be aware of something to go around it?
Reply With Quote
  #18  
Old 04-16-2020, 02:40 PM
macropod's Avatar
macropod macropod is offline Abbreviations Validation - Word Windows 7 64bit Abbreviations Validation - Word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by mrsandes View Post
So if I were to test the results with the search looking for all matches (without parenthesis), I would have to add the '|' characters to each of the found acronyms? That's what the replace line is doing, right?
No, it's not as simple as adding the | character. You would do better to do a search for such acronyms and make sure they're properly formatted to begin with.
Quote:
Originally Posted by mrsandes View Post
That change has a side effect of replacing the first instance of the acronym to all uppercase letters definition, so the first instance looks like: PARTS LIST (PL). Would you be aware of something to go around it?
You could insert:
.MatchCase = True
before:
.Replacement.Text = StrExp & " (" & StrAcc & ")"
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Abbreviations Validation - Word Creating a list of Acronyms / Abbreviations daithy Word 4 03-12-2020 01:52 PM
Data Validation in Microsoft Word Template BradleyCase Word VBA 1 07-16-2019 12:37 PM
Adding Professional Credential Abbreviations to Name dyny723 Outlook 0 03-16-2018 07:14 AM
Abbreviations Validation - Word Automate Job application word doc to Excel (with data validation) dylansmith Office 1 02-11-2018 12:58 PM
validation email address in word text filed sameerahmad_P Word VBA 1 03-07-2014 02:59 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:42 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft