We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Using Word Documents as Templates, how to store metadata

We are currently investigating new ways to generate word documents.
We want to create a more powerful templating mechanism than the existing Mail Merge function, and something easier to use than LINQ Reporting Engine.

We are envisioning something like the following:

  1. the customer gives a sample word document to us. It has all the required styles and contains example data.
  2. We open the word document in a tool very similar to the Aspose Document Explorer.
  3. The Word document is shown as a tree of nodes.
  4. We can select “Run” Nodes and bind their content to our data. This will be used to transfer Field Level Data like Names or Adresses to the document
  5. We can also select other nodes like TableRow or Sections and replace them with a “for-each Expression”.
  6. for-each Nodes can be nested. This is not possible with Mail Merge.

steps 4, 5 and 6 mean that we need to “enrich” the word document with our own metadata. It is similar to enriching a HTML Template with *ngIf directives or binding expressions.

Because steps 3-6 are made in a custom “report designer” application, the “report designer” can provide intellisense. for example, because the “report designer” knows that the current Node is inside a foreach loop which iterates over customer objects, it can offer the properties of the customer class.

My questions are:

A) Does the Word Document Model have properties where such information can be stored? Like a string Property called “Tag” or “Reserve” where we can store these “enrichments”?

B) Or is there a way to identify Document Nodes? If a document node has dome sort of Identifier, then we could store this information in a document variable. For example
doc variable metadata = “ID123:foreach(customer c in myObj.Customers)”

Best Regards



Aspose.Words’ document object model does not has such properties to store information.

Aspose.Words does not provide API to attach an identifier with node. It imports the contents of document that are stored in it.

Could you please ZIP and attach your input document, document with such properties and expected output document? We will then provide you more information about your query.