Embedding Objects in Microsoft Word and OpenOffice Writer

I am looking for some recommendations on how to implement the following function:

the ability to embed objects (for example, diagrams) in word processors and the ability to edit them in the corresponding "obscene" application

For example, MS Word and Visio work in the same way, which allows the user to easily edit / customize diagrams after adding them to a word processor.

I am wondering how this is done on the following platforms:

  • Microsoft Word
  • Openoffice

So far I know that:

  • Microsoft Word - uses OLE / COM
  • Open Office - uses UNO

Can you point me to any links, examples, books on how to approach this?

PS: Every time I try to find the MSDN for this, I get the impression that I'm in the wrong place. = (

+4
ms-office com ole uno
source share
2 answers

Since OLE is an almost prehistoric technology (still in use), you need to dig deeper into MSDN. The following article describes an example application that can be embedded in container applications such as IE, Word, or OpenOffice. The sample is based on VC6, so I don’t know how much luck you have to run with the current versions of Visual Studio.

Creating an OLE Server

Probably the easiest option to create an OLE control (.ocx) is to use the old Visual Basic 6. This is described here:

How to create and use a minimal ActiveX component in VB

It is also possible to write a control in managed code, such as C #, but I assume this is not recommended 1 because it can lead to conflicts if another version of the CLR is already running in the current process (So far, only one version of the CLR can exist in the process , .NET 4.0 will introduce CLR execution side by side). I found the following tutorial:

Create ActiveX in .NET Step by Step

1 See the warning below in this article by Andrew Whitechapel.

+4
source share

This can be done quite easily in Word using COM (or OLE, but it's the same with the new name). Depending on what language you intend to do this, you will go differently. Essentially, you need to create a specific type of ActiveX control.

In Delphi (the easiest language for this) you have to create an ActiveXForm in the COM dll, and then you can paste this into your text document. You could make your application as you like in Word (talking with Word is a bit more, but possible).

I do not know what to do in OpenOffice. I'm afraid.

I think you need to return to more specific issues.

+1
source share

All Articles