MS Word:如何有效地创建构建基块?

发布于 2024-09-13 12:05:21 字数 443 浏览 1 评论 0原文

我需要创建一个具有定义的内容控件的 Building Block Gallery,以便其他人可以轻松创建准备接受我的数据的 Word 文档。我正在努力让用户尽可能轻松地做到这一点。

我想确保所有这些都是专业完成的并且看起来不错,所以我不想确保所有内容控件基本上都是相同的,只是名称/标签和原始内容不同。在 Word 中执行此操作并不那么容易,并且需要一些时间。有时,当我更改其中的内容时,它会从灰色文本更改为标准,有时则不会(不确定为什么,认为这与我如何覆盖“在此处放置文本”的方式有关)。所以我认为以编程方式进行是可行的。

然后我在一些 OpenXML FAQ 中读到这是不可能的。我不明白的事情。如果我将 Building Block 存储在 .dotx 文件内,它一定位于 XML 内的某个位置,对吧?我应该能够访问它。它存储在哪里?

我非常感谢这里的指点,主要是如何在自定义构建块库中创建多个内容控件这一问题的答案。

I need to create a Building Block Gallery with defined Content Controls to make it easy for others to create word documents that would be ready to accept my data. I'm trying to make this as painless for the users as possible.

I wanted to make sure all this would be professionally done and look good so I wan't to make sure all the Content Controls are basically the same just with different Names/tags and original content. Doing this inside Word isn't so easy and would take some time. Sometimes when I change the Content inside it changes from the greytext to the standard and sometimes it doesn't ( not sure why, think it has to do with how I overwrite the "place text here" thing). So I thought doing it programatically would work.

Then I read in some OpenXML FAQ that this isn't possible. Somthing that I do not understand. If I store the Building Block inside a .dotx file it mus be somewhere inside the XML there right? I should be able to access it. Where is it stored?

I would be greatful for pointers here, mainly the answer to the question how do I create multiple Content Controls inside a custom Building Block gallery.

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

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

发布评论

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

评论(2

雨落□心尘 2024-09-20 12:05:24

我知道这是一个老问题,但万一其他人正在寻找或原始海报仍然关心......

在 VBA(和 VSTO)中,您可以创建构建块(可以有内容控件)。您可以将样式和其他属性设置为相同,以便它们保持一致(以获得专业品质的外观)。

然后,您可以将它们保存在 Build Blocks 模板 %appdata%\Microsoft\Document Building Blocks\1033\14\Custom Building Blocks.dotx 中,其中 1033 是语言的编号,14 是 Office 版本的编号( 13 = Office 2007、14 == Office 2010、15 == Office 2013 等)

我认为此方法比编辑 Open Office XML 更容易。

I know this is an old question, but in case other people are looking or the original poster still cares...

In VBA (and VSTO) you can create Building Blocks (which can have Content Controls). You can set the Styles to be the same, and other attributes so that they are consistent (for the professional quality look).

You can then save them in a Build Blocks template %appdata%\Microsoft\Document Building Blocks\1033\14\Custom Building Blocks.dotx" where 1033 is the number for the language, and 14 is the number for the version of Office (13 = Office 2007, 14 == Office 2010, 15 == Office 2013, etc.).

I think this method will be easier than editing the Open Office XML.

凝望流年 2024-09-20 12:05:23

内容控件可以很好地存在于构建块中。事实上,Word 2007 附带的大多数内置构建块都包含内容控件。

运输构建块存储在:

  • 在 Word 2007 中:“%appdata%\Microsoft\Document Building Blocks\1033\12\Building Blocks.dotx”
  • 在 Word 2010 中:“%appdata%\Microsoft\Document Building Blocks\1033\14\内置构建块.dotx”。

我认为您可以创建自己的 .dotx 文件(具有自己的构建块)并将其放在同一文件夹中,以便 Word 在启动时加载它。

在 .dotx 文件本身中,它存储在 \word\glossary\document.xml 下。

如果您无法至少手动创建一个包含内容控件的构建块条目,我会感到惊讶。我不知道 OpenXML SDK 是否可以做到这一点 - 当它提到不可能时,可能只是它没有能力这样做,而不是说它在技术上是不可能的。

Content controls can live inside building blocks just fine. In fact, most of the built-in building blocks that Word 2007 ship with include content controls inside them.

The shipping building blocks are stored:

  • In Word 2007: "%appdata%\Microsoft\Document Building Blocks\1033\12\Building Blocks.dotx"
  • In Word 2010: "%appdata%\Microsoft\Document Building Blocks\1033\14\Built-In Building Blocks.dotx".

I think you can create your own .dotx file (with its own building blocks) and place it in the same folder to get Word to load it on boot.

In the .dotx file itself, its stored under \word\glossary\document.xml.

I'd be surprised if you couldn't create a building block entry that had content controls in it manually, at least. I don't know if the OpenXML SDK can do it - when it's mentioned that it isn't possible, it just might be that it doesn't have the capability to do so, and not that it's technically impossible.

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