重复内容的Office Open XML [英] Repeating content with Office Open XML

查看:132
本文介绍了重复内容的Office Open XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经检查出什么是可能的的Office Open XML规范文档。我在能够自定义XML的内容添加到文档并将其绑定到内容控件特别感兴趣。我想知道是否有可能有重复的内容控制型?

I've been checking out what is possible with the Office Open XML specification for documents. I'm particularly interested in being able to add custom XML content to a document and binding it to content controls. I was wondering if it is possible to have a repeating content control type?

举例来说,假设我有我的.docx文件的一些自定义XML看起来像这样:

For example, say I have some custom XML in my .docx file that looks like so:

<Work>
  .
  .
  <People>
    <Person>
      <Name>Jane Doe</Name>
      <EmailAddress>jane@abc.com</EmailAddress>
    </Person>
    <Person>
      <Name>John Doe</Name>
      <EmailAddress>john@xyz.com</EmailAddress>
    </Person>
  </People>
</Work>

有没有重复的内容控制(类似于ASP中继),我可以用它来生成输出,看起来像

Is there any repeating content control (similar to an ASP repeater) that I could use to generate output that looks something like

  • 李四(jane@abc.com)
  • 李四(john@xyz.com)

如果没有类型的控件,我想我可以做一些处理上的word文档本身生成一个列表。有没有人这样做,有一些有用的指针?

If there are no types of controls, I guess I could do some processing on the word document itself to generate a list. Has anyone done this and have some helpful pointers?

推荐答案

由于0xA3执行说,没有什么内建这样,这将是Wordpro​​cessingML中操纵的。但这里是拉动数据从数据库中创建多个条目的一个例子:<一href="http://blogs.msdn.com/b/brian_jones/archive/2009/01/19/pushing-data-from-a-database-into-a-word-document.aspx"相对=nofollow>从数据库将数据推到Word文档。

As 0xA3 says, there is nothing built-in like this, it would be WordprocessingML-manipulated. But here is an example of pulling data from a database to create multiple entries: Pushing Data from a Database into a Word Document.

此外,在数据绑定一般的主题,这里是一个很好的入门教程:<一href="http://blogs.msdn.com/b/acoat/archive/2007/03/01/linking-word-2007-content-controls-to-custom-xml.aspx"相对=nofollow>链接的Word 2007内容控件添加到自定义XML 。

Also, on the subject of databinding in general, here is a good starter tutorial: Linking Word 2007 Content Controls to Custom XML.

这篇关于重复内容的Office Open XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆