[dba-Tech] Word VBA question

Susan Harkins ssharkins at gmail.com
Mon Aug 5 16:20:43 CDT 2019


Hi everyone!

I need to copy a range to a new Word document, but it's a complicated
search. When the search pattern find a match, I need to select the words to
the left -- using the length of the match (which can change, I'm using
wildcards). I'm stumped. 

An example: 

The search string matches (BBB) at the text, Better Business Bureau (BBB). I
need to copy the definition of the acronym, to the left of BBB, and the
acronym. The acronym is easy. But I can't figure out for the life of me how
to set a range to "three words to the left of BBB". 

I'd like to avoid using Selection because the editors will be working with
big documents. If that's the only way it can be done, that's the route I'll
go. But I'd rather set a range -- just can' figure out how to do it. 

Thanks!
Susan H. 



More information about the dba-Tech mailing list