How to make a docx file, requires some custom plugin when opened

53 views Asked by At

I have an use case in my web application where user can download a DOCX file that has some custom properties added to it required for our word add-in, open it and do some editing or some other stuff using the word add-in. It worked totally fine when the add-in is already installed in user machine. Otherwise I want to notify(some validation popup) user to install the particular add-in when user tries to open the particular document. Is there any way to add some properties to the document about requirement of the specified add-in? If yes then how? I would appreciate any help??

1

There are 1 answers

0
Dirk Vollmar On BEST ANSWER

There is no built-in mechanism in Word to display a message based on a document's metadata. I see two ways you could achieve that:

  1. Theoretically, you could embed a macro in your document that checks the presence of your add-in when the document is opened and then displays a message. However, by default (and for very good reasons) Word prevents macros from running in files downloaded from the Web. Thus, such a solution only would work with a very insecure Office configuration.
  2. Display a message in your web application instructing users to download the add-in. This can be achieved easily; the only disadvantage is that users who already downloaded the document previously won't see the message again when they actually open the document.