【问题标题】:Select text of a particular shading color (VBA macro)选择特定底纹颜色的文本(VBA 宏)
【发布时间】:2017-06-23 22:40:54
【问题描述】:

我正在尝试使用宏来选择 word 中特定阴影的文本(我稍后想更改该阴影并突出显示它)。

我在选择特定底纹颜色的文本时遇到问题。

使用

char.Font.Shading.BackgroundPatternColor wdColorAutomatic

工作,选择自动以外的任何阴影的字符,但使用

char.Font.Shading.BackgroundPatternColor = wdColorYellow

不起作用。我希望能够选择具有特定阴影颜色的文本。关于为什么这不起作用或什么可能更有效的任何想法?

谢谢

【问题讨论】:

    标签: vba ms-word highlight shading


    【解决方案1】:

    请注意,“阴影”具有 ForegroundPatternColorBackgroundPatternColor。如果您仅更改 Shading 对话框中的 Pattern 设置,则检查 BackgroundPatternColor 将返回 wdColorAutomatic。如果您更改 Fill 设置,BackgroundPatternColor 将返回颜色。

    如果您想为 Pattern 部分返回颜色,请改为检查 ForegroundPatternColor。或者两者都...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-26
      • 2021-05-22
      • 1970-01-01
      • 2014-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多