Search code examples
c#jsonword-addins

Where to store json string in word document?


I would like to implement WordAddin. I need to have json list related in my word document. My functionality search word document and base on some criteria crate json string.

I would like to store this json string in word document and use it later if needed. It would be perfect to easy store and easy get this json. I want have all data in word document, so separate files or database are not options.

My question is: where to store this json string?

Possible solutions I can see are :

  • Save on document as text and then hide and protect this text
  • Save to file and attach this file to word document (protect and hide)

Is there some better place where could I store data like this in word document?


Solution

  • Each Microsoft Word document has metadatas and properties. I would recommend to store your Json into one of these.

    Here's some examples on how to do it:

    Note that properties can be read by the users (if they know what they are searching for).