Search code examples
javascripthtmlms-wordcomole

Paste OLE(Object Linking & Embedding) object directly into web page


I have a large word (ms-word) file that contains lots of facts and formulas regarding science and mathematics. The word file contains lots of text, mathematical equations (derivatives, limits, integrals and many more), chemical formulas (benzene structure) and other figures.

I am planning to put all the content on the web so that students can access the study material from anywhere. I need to copy the facts and formulas and directly paste it into the field on the web page. The problem i am facing is that only the text part is being copied.

After a bit of research, i found that the figures and formulas are ole objects and not images. So one possible solution could be to save the ole objects as images and then paste the formatted content on web page, but this is extremely time-consuming.

So i am looking for a way to directly copy the content (contains text and ole objects) and paste it into the web page (that is a field in the web page that allows pasting everything from clipboard).

Please help me figure out a solution. For Math equations we use MathType and for chemical structures, we use acd chemsketch.


Solution

  • We can directly achieve that by pasting the copied content directly in html page with the following field:

    <div id="pasteArea"  contenteditable="true"></div>
    

    All the OLE objects will be converted to equivalent images (a bit lower in quality so before copying the content enlarge the OLE objects a bit!). The contents of the <div> would be html content.

    This works only for client based html pages as images (converted from OLE objects) are picked up from a local machine path. If we are able to load these images and upload them along with the text content, we get the work done. Thank you.