更改Word的背景颜色的Mac

发布于 2025-01-31 10:42:57 字数 328 浏览 3 评论 0原文

如何更改Mac Word中的页面背景颜色(使用RGB)?

我尝试了“记录宏”工具,但这是一个空白的宏。

我在Word for PC中使用的宏:

ActiveDocument.ActiveWindow.View.DisplayBackgrounds = True
ActiveDocument.Background.Fill.Visible = msoTrue
ActiveDocument.Background.Fill.ForeColor.RGB = RGB(200, 222, 250)
ActiveDocument.Background.Fill.Solid

How can I change page background color (using RGB) in Word for Mac?

I tried the “record macro” tool but that was a blank macro.

The macro I use in Word for PC:

ActiveDocument.ActiveWindow.View.DisplayBackgrounds = True
ActiveDocument.Background.Fill.Visible = msoTrue
ActiveDocument.Background.Fill.ForeColor.RGB = RGB(200, 222, 250)
ActiveDocument.Background.Fill.Solid

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

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

发布评论

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

评论(2

人│生佛魔见 2025-02-07 10:42:57

我不在Mac上,而是看看颜色常数之一是否满足您的需求。

因此,我无法告诉您为什么您的宏不起作用。对不起。

代替activedocument.background.fill.forecolor.rgb = rgb(200,222,250)尝试类似activedocument.background.fill.fill.forecolor = wdcolorlightgreen之类的东西。这对应于RGB = 204、255、204。

这是a 颜色常数列表带有相应的RGB设置。

I am not on a Mac, but see if one of the Word color constants meets your needs.

So, I can't tell you why your macro is not working. I'm sorry.

Instead of ActiveDocument.Background.Fill.ForeColor.RGB = RGB(200, 222, 250) try something like ActiveDocument.Background.Fill.ForeColor= wdColorLightGreen. That corresponds to RGB = 204, 255, 204.

Here is a list of the Word Color Constants with the corresponding RGB settings.

中性美 2025-02-07 10:42:57

不幸的是,这无法在Mac版本上使用,因为它不能让您访问document.background对象。如果您在view-> object中查找它,则在那里,但已隐藏。

AIUI如果您在Windows上设置了背景颜色,则仍然可以在Mac上 IT,如果您在Word-和gt中检查了相关选项,请在Mac上 print IT ;首选项。您只是无法设置或更改它。

我也看不到任何特别好的选择。我看不到在AppleScript中做到这一点的方法。您可以在标头或页脚中创建页面大小的矩形形状(以便在单词部分中显示在所有页面上)并指定填充,但它的行为会有所不同(即,它可能会打印出偏好中设置的任何内容,并且如果您的文档有多个部分,则需要确保其形状在所有部分中)。或者,如果您以Word XML格式保存文档,则可以在此处添加/修改必要的XML元素。您必须检查在Windows版本上创建的文档,以确切查找所需的XML。 (我也看不到使用VBA的insertXML方法插入此XML的方法)。

NB我在这里没有足够的积分来发表评论,因此,如果您有任何后续行动,请在此答案中寻找更改(假设我可以更改它!)

Unfortunately, this won't work on the Mac version because it does not let you access the Document.Background object. If you look for it in View->Object, it is there but it is hidden.

AIUI if you set the background color on Windows, you can still see it on Mac, and print it on Mac if you check the relevant option in Word->Preferences. You just can't set it or change it.

I can't see any particularly good alternative either. I can't see a way to do this in AppleScript. You could create a page-sized rectangular shape in a header or footer (so that it appears on all pages in a Word section) and specify a fill, but that will behave differently (I.e. it will probably print whatever is set in Preferences, and if your document has multiple sections, you will need to ensure that the shape is in all of them). Or if you saved the document in Word XML format, you could add/modify necessary XML elements there. You'd have to inspect a document created on the windows version to find out exactly what XML you needed. (I cannot see a way to insert this XML using VBA's InsertXML method either).

NB I do not have enough points here to post comments, so if you have any follow-up, look for changes in this Answer (assuming I can change it!)

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