Sorry if this answer is not perfect, but with the age of the question and how many people are interested in it, I thought I would take a picture and hope to help someone, if not OP.
I'm not sure how VML / Word handles clipboard data. If it puts several formats on the Windows clipboard, one with the right HTML and one with the VML format, then you're in luck and that should work. If not, then perhaps you can use this to at least clear the code in the insert.
You want to see IDocHostUIHandler :: TranslateAccelerator . You need to implement IDocHostUIHandler if you have not already done so. You use ICustomDoc :: SetUIHandler to register after loading the HTML document (it may be a blank page if you use this).
Inside TranslateAccelerator you need to look at nCmdID == IDM_PASTE . This starts before the user pastes something into the HTML control, and you can change the contents of the clipboard before the paste occurs.
You can use something like GetClipboardData (RegisterClipboardFormat ("HTML Format")) to get the HTML format from the clipboard. You can use SetClipboardData to replace clipboard data.
For your use, if you see that after copying from Word there are several clipboard formats, you can simply delete one of the formats that you do not need. That way, when the HTML control finishes pasting, it will only use the format you want.
I have code examples if necessary, but they are part of a large project and use the Borland VCL library for some parts. My code checks the CF_BITMAP format on the clipboard and converts it to HTML instead of a PNG file. So that users who embed the screen capture in the control get a smaller PNG image instead of a huge BMP file. The concept is about the same as you want.
source share