简体   繁体   English

在 MS Word 中使用 VBA 更改所选表单域的颜色

[英]Change color of selected form-fields with VBA in MS Word

Is there any way to globally change the selection color of all form-fields in MS Word?有没有办法全局更改 MS Word 中所有表单域的选择颜色? I have a test form that I fill out as I'm doing a test.我有一个测试表,我在做测试时填写。 My eyes go back and forth between the meters I read and the form I fill out.我的眼睛在我阅读的仪表和我填写的表格之间来回走动。 I then tab to the next field to fill out and read another meter.然后,我跳到下一个字段以填写并读取另一个仪表。 The default colors of the form-fields between when the field is selected for input and when it is not is not very different.表单字段的默认 colors 在选择字段进行输入和不选择输入字段之间没有太大区别。 I find myself trying to find my place again when looking at the form again.再次查看表格时,我发现自己试图再次找到自己的位置。

Is there any way to globally change the color of all form-fields so that the color when it is selected is much different than the color when not selected?有没有办法全局更改所有表单字段的颜色,以便选择时的颜色与未选择时的颜色有很大不同? Thanks.谢谢。

Keep in mind that the form is protected so that only changes to the fields are allowed.请记住,表单受到保护,因此只允许更改字段。 So I will have to unprotect the document before I can change it and then reprotect it after I'm done.所以我必须先取消保护文档,然后才能更改它,然后在完成后重新保护它。 This much I can do.我能做的就这么多了。 I can change colors when I enter and exit a field.当我进入和退出一个字段时,我可以更改 colors。 But this slows down how fast I can fill out the form.但这会减慢我填写表格的速度。 So I was hoping there was a property I could set to change only the selection color and cycle through all fields when the document is first opened.所以我希望有一个属性可以设置为仅更改选择颜色并在首次打开文档时循环遍历所有字段。 Any suggestions out there?有什么建议吗?

Sorry, the only options for form fields are grey or uncolored.抱歉,表单域的唯一选项是灰色或无色。 To switch between those 2, VBA is not required.要在这 2 个之间切换,不需要 VBA。 Instead, choose Developer>Legacy Forms and click the 5th icon from the left Form Field Shading (looks like an a with hatch marks around it).相反,选择Developer>Legacy Forms并单击左侧表单字段阴影的第 5 个图标(看起来像一个带有阴影标记的 a)。

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

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