从Word文档中找到选定的单词

发布于 2025-02-09 19:06:45 字数 164 浏览 1 评论 0原文

我正在尝试使用Word VBA从Word文档中找到选定的单词

Selection.find.Execute FindText:="([0-9]{1,})([To])([0-9]{1,})", MatchWildcards:=False, Forward:=True

I'm trying to find selected words from Word document using Word VBA but I'm getting stuck e.g. "25to30" anysuggestions below are the code used in wordvba

Selection.find.Execute FindText:="([0-9]{1,})([To])([0-9]{1,})", MatchWildcards:=False, Forward:=True

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

相守太难 2025-02-16 19:06:46

关于是否有“ to”的任何一侧的空间:

FindText:="(<[0-9]@)(To)([0-9]@>)

或者

FindText:="(<[0-9]@)( To )([0-9]@>)

,除非您要使用所发现的各个组件做某事,否则没有意义。

Dpedending on whether there is a space either side of 'To':

FindText:="(<[0-9]@)(To)([0-9]@>)

or

FindText:="(<[0-9]@)( To )([0-9]@>)

And, unless you're going to do something with the individual components of what you find, there's no point having the parentheses.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文