【问题标题】:How to make the words located within a scrollable ActiveX Control Text Box searchable?如何使位于可滚动 ActiveX 控件文本框中的单词可搜索?
【发布时间】:2019-08-22 13:24:51
【问题描述】:

在 word 2016 中,我使用开发者工具创建了一个可滚动的文本框。我使用的控件是 ActiveX 控件文本框。当我单击“Ctrl F”时,我无法在文本框中找到文本。我应该怎么做才能在这些乱七八糟的 ActiveX 文本框中找到文本?我需要编写一些 VBA 代码还是只是一个简单的修复?

【问题讨论】:

标签: vba ms-word developer-tools


【解决方案1】:

ActiveX 控件将文本存储在其二进制文件中,Word 的查找和替换实用程序无法搜索该文件。您可以使用 VBA 进行搜索。

Sub FindReplaceText()
  AXText$ = TextBox1.Value
  If InStr(1, AXText$, "text", vbTextCompare) > 0 Then
    AXText$ = Replace(AXText$, "text", "fish")
  End If
  TextBox1.Value = AXText$
End Sub

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-10
    相关资源
    最近更新 更多