Re: SetText Method Confusion

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Klaus Linke (info_at_fotosatz-kaufmann.de.no.junk)
Date: 08/12/04


Date: Thu, 12 Aug 2004 23:44:57 +0200

Hi Jonathan,

The DataObject and SetText method belong to the Forms library.
You could check if the code works after you add a UserForm to your project.

But there should be better and faster ways to achieve the result you want.
Copying a doc to another doc one word at a time using the clipboard is
likely to be very slow and error-prone.

Have you considered making a copy of the document? You then could change
the text with "Find/Replace" as desired.

To find CAPITALIZED words longer than 1 letter (which includes lots of
acronyms and abbreviations), you could look for <[A-Z]{2,}> with a wildcard
search.
After you have found a match, you could turn the matched text to lower
case, prepend "~~~" ...

Greetings,
Klaus