Free Support Forum -

Embed javascript in my word document for html conversion


I would like to embed javascript in my Word document so that it is not seen in the document itself, but is rendered when I convert from Word to Html. Is this possible?

Here’s what I did try that almost did work…

1. Enter the following text in the document.

2. select the javascript
3. On the format menu, click font, then select font tab
4. select the “hidden” checkbox

… unfortunately the script tags (<script…>) were removed during the conversion, leaving just the document.write. Maybe there is a way around this, but I don’t know it.


Hi Ryan,

Thanks for your inquiry.

Unfortunately, there is no way to add JavaScript to HTML using Aspose.Words. Aspose.Words does not deal with Javascript and no Javascript is read or written during open and save. May be you should post-process your HTML to add Javascript in output HTML document. If we can help you with anything else, please feel free to ask.

Best regards,