Word 2007 架构库存储在哪里?
Word 2007 允许将 XML 架构附加到文档(在开发工具栏 | XML 组 | 架构按钮下)。这个模式库信息存储在哪里?
我有一些使用基于架构的自定义 XML 标签创建的文档,但是当我将文档和架构传递给其他人时,架构被标记为不可用,可能是因为架构的文件位置不同。
是否有某种方法可以编辑此信息以更改给定架构的路径?
Word 2007 allows XML schemas to be attached to a document (under the Developer toolbar | XML group | Schema button). Where is this schema library information stored?
I have documents that I have created with custom XML tags based on a schema but when I pass on the document and the schema to someone else the schema is marked as unavailable, presumably because the file location of the schema is different.
Is there some way to edit this information to change the path to a given schema?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它不与 docx 一起存储,只存储它的路径。因此,传递文档几乎总是会破坏链接。 VSTO 可以通过将 XSD 作为资源嵌入到应用程序中来解决此问题。
但对于 VBA 来说,这就更棘手了 - 您需要有一个可以依赖每个用户计算机的路径,然后在那里部署您的 XSD。一种方法是同步
Document_Open
(或仅使用AutoOpen
)事件,以便当用户打开文档时(警告:需要注意宏安全性),您可以简单地“编写”XSD,将其硬编码为代码隐藏中的字符串,然后将其写入文件,然后使用如下例程附加该文件:因此,由于您不会留下工件,因此您可以通过
Document_Close
或AutoClose
从用户计算机中删除该 XSD。It's not stored with the docx, just the path to it is stored. So passing a document around will almost always break the link. VSTO can get around this by embedding the XSD as a resource in the app.
But for VBA, it's trickier - you need to have a path you can rely on on each user's computer and then deploy your XSD there. One way is to synch the
Document_Open
(or just use theAutoOpen
) event so that when a user opens the document (warning: macro security needs to be dinked around with), you can simply "write" your XSD that is hard-coded as a string in code-behind and then write it to a file and then attach that file with a routine like:So as you're not leaving behind artifacts, you could then delete that XSD from the user's computer on
Document_Close
orAutoClose
.