简体   繁体   中英

VBA: Is it possible to use .MoveStartUntil with the cset is a word?

Is it possible to use .MoveStartUntil with the Cset is equal to a word? Like for example,

With Selection
    .MoveStartUntil cset:="Why", count:=wdBackward
End With

The problem is that it only go backward until any of the letters in the word "Why" is encountered so if it encounter other words that has a "W", "h" or "y" in it, it stop there. Is there a way to make it move to start until it reaches the specific word and not by the letters of the given word? Thank you in advance.

Programming documentation is like a statue law. It says only what it means.

Moves the start position of the specified range or selection until one of the specified characters is found in the document. If the movement is backward through the document, the range or selection is expanded.

Any observed behaviour, not documented, is not to be used.

It's is a contract. Follow the rules and your program should work forever.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM