简体   繁体   English

VBA:可以将cset用作.MoveStartUntil吗?

[英]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? 是否可以在Cset中使用.MoveStartUntil等于一个单词? 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. 问题是它只会向后退直到遇到单词“ Why”中的任何字母,因此,如果遇到其他单词中包含“ W”,“ h”或“ y”的单词,它将停止在此位置。 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. 遵循规则,您的程序将永远有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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