如何将自定义图标添加到 Word 中的自定义功能区选项卡?

发布于 2024-08-24 05:02:11 字数 534 浏览 7 评论 0原文

我正在尝试将自定义图标添加到 Microsoft Word 的共享加载项共享加载项使用 XML 将选项卡添加到 Word 的功能区。

我正在遵循 MSDN 上的本文档的指导:我已关注文档中描述的将图像添加为资源的步骤。当我运行安装程序并打开 Word 时,图标不显示。

另外,我收到无法注册程序集/文件路径/访问被拒绝。请确保您以管理员身份运行该应用程序。对注册表项 HKEY_ClASSES_ROOT/RibbonTest.Connect 的访问被拒绝。

我的 Windows 安装上只有一个用户,它是 Admin,所以我不确定这意味着什么。

有谁知道会发生什么?

作为参考,我正在 Windows 7 上的 VS Studio 2008 for Word 2007 中编写代码

I am trying to add custom icons to a Shared Add-in for Microsoft Word. The Shared Add-in uses XML to add a tab to Word's Ribbon.

I am following the guidance of this document on MSDN: I have followed the steps described in the document for adding the image as a Resource. When I run the installer, and open Word the icons do not show up.

Also, I am getting a Cannot register assembly /file-path/ access denied. Please make sure you are running the application as Administrator. Access to the registry key HKEY_ClASSES_ROOT/RibbonTest.Connect is denied.

There is only one user on my windows install and it is Admin, so I am not sure what this means.

Does anyone know what might be going on?

For reference sake,I am writing the code on Windows 7 in VS Studio 2008 for Word 2007

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

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

发布评论

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

评论(1

扛刀软妹 2024-08-31 05:02:11

各种不同的按钮类型需要不同的图像尺寸。例如,大按钮使用 32 x 32 像素的图像。小按钮适用于从 16 x 16 开始的图像。

如果图像太小,它将不会显示在功能区中。

有关详细信息,请参阅此 MSDN 文章细节。您需要记住的两个属性是强大的图像尺寸。使图像的大小与控件的大小相匹配。 MSDN 文章中有一个表格应该可以更清楚地说明这一点。

The various different buttons types require different image sizes. Large buttons use a 32 x 32 pixel image for example.Small buttons work with images starting at 16 x 16.

If an image is too small, it won't show up in the ribbon.

See this MSDN article for more detail. The two attributes you need to keep in mind are strong image and size. Make the size of the image matches the size of the control. There is a table in the MSDN article which should make this more clear.

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