Page 1 of 1

Pure embedded OCX controls

Posted: Thu Apr 26, 2012 4:00 am
by Mr Andreas
Spotted this cool demo showing how to embed a YouTube video: http://www.trichview.com/forums/viewtopic.php?t=3703

I need to do something similar to the demo. What I need to be able to do is embed any registered OCX control (mainly basic controls to start with), not the resulting Delphi wrapper. Then I need to be able to save the file as an RTF and keep the OCX controls embedded in the file to then be opened in something like Word and still be able to see the controls. What do I need to do to achieve this?


-Andreas

Posted: Sun May 13, 2012 7:27 pm
by Sergey Tkachenko
Sorry for overlooking this question.

Does MS Word allow to embed arbitrary OCX controls directly in a document (not in a VBA form)?

Posted: Sun May 13, 2012 10:08 pm
by Mr Andreas
Sergey Tkachenko wrote:Sorry for overlooking this question.

Does MS Word allow to embed arbitrary OCX controls directly in a document (not in a VBA form)?
Yes, as long as it is registered, arbitrary OCX controls can be inserted into normal Word documents.

Posted: Mon May 14, 2012 4:33 pm
by Sergey Tkachenko
But how? I can see (in MS Word) the command for inserting object.
It corresponds not to inserting ocx, but to insertion of TOLEContainer.

Posted: Tue May 15, 2012 11:59 pm
by Mr Andreas
Sergey Tkachenko wrote:But how? I can see (in MS Word) the command for inserting object.
It corresponds not to inserting ocx, but to insertion of TOLEContainer.
Hmm, yes, my mistake.

Ignoring this, how does one go about inserting non-container OCX controls that Words can insert, such as check-boxes, for example?

Posted: Fri May 18, 2012 1:51 pm
by Sergey Tkachenko
Well, as I can see, there three ways to add controls in Word 2007.
1) Some new type of controls, that cannot be saved to RTF (Word shows a warning)
2) Some controls that saved as fields in RTF (unfortunately, a format of this field is not described in RTF specification)
3) ActiveX. They are saved almost exactly in the same way as OLE container document.
However, it may require some significant time to implement loading and saving of ActiveX in RTF. We are not ready to do this work in near future, sorry.