View Single Post
 
Old 11-16-2021, 09:25 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Yes, the code can be adapted to output to an Excel worksheet. See this thread for a code example that could be adapted to this task.
https://www.msofficeforums.com/word-...perscript.html

To include lower case is a bit more difficult as it requires tradeoffs and decisions. It most likely requires multiple passes
This existing search string finds capitals and numbers with at least two characters
.Text = "\([A-Z0-9][A-Z&0-9]{1" & Application.International(wdListSeparator) & "}\)"

To include lowercase characters you need to include multiple passes to keep out regular camel case words (eg Hello, To, iPhone) but get three+ character instances (eg BoM, MgO2). A search string for that might be
.Text = "\([A-Z0-9][a-z&][A-Z&0-9]{1" & Application.International(wdListSeparator) & "}\)"
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote