开发者

Programming Word XML in .NET

开发者 https://www.devze.com 2023-01-13 20:42 出处:网络
I\'m currently in a development team trying to come up with an app that will开发者_如何学Go be able to accept an Open XML Word document, shred the XML and somehow come up with UI screens on the fly th

I'm currently in a development team trying to come up with an app that will开发者_如何学Go be able to accept an Open XML Word document, shred the XML and somehow come up with UI screens on the fly that could be used for data entry.

I'm using the Open XML SDK but my challenge has been to come up with a very generic means of representing the document as the SDK requires that a static representation (call it a template or mask) be defined in code which can then be used to shred the document programmatically.

As an example to shred a certain doc, i have to go into code and define the theme, fonts, paragraph style etc of the word doc in order for the program to "know" how to shred it.If the style of the doc changes then the program also has to change.

My question is, is there a way of doing this generically so that i wont have to care about the style used in coming up with the word document? Has anyone attempted generating screens/ data entry fields from a word document before.

Any help will be appreciated.


Open XML allows you to use an xml schema to bind data to certain parts of the document with content controls. You can then use the xml schema as a starting point for your data entry app.

Mapping content controls to custom xml:

  • http://msdn.microsoft.com/en-us/library/bb398244.aspx
  • http://msdn.microsoft.com/en-us/library/bb510135%28office.12%29.aspx

Either you have control over the custom xml in the document and your UI is pretty static, or you could generate a data entry user interface on-the-fly based on the custom xml schema

I think there is a way to have Word itself serve as your data-entry UI, so you won't even need a custom UI.

0

精彩评论

暂无评论...
验证码 换一张
取 消