将对象嵌入到Microsoft Word和OpenOffice Writer中 [英] Embedding objects into Microsoft Word and OpenOffice Writer
问题描述
我正在寻找如何实现以下功能的一些参考:
将对象(例如图表)并且能够在各自的母亲应用程序中编辑它们。
例如,MS Word和Visio一起工作,
我对在以下平台上的操作感兴趣:
- Microsoft Word
- OpenOffice
到目前为止,我知道:
- Microsoft Word - 使用OLE / COM
- 开放Office - 使用 UNO
你可以指点我任何参考,例子,如何处理这本书的书?每次我尝试搜索MSDN为此,我得到的印象,我在错误的地方。 =
由于OLE是一个几乎是史前的技术(仍然使用),你必须在MSDN 。下面链接的文章介绍了一个可嵌入到容器应用程序(如IE,Word或OpenOffice)中的示例应用程序,该示例基于VC6,因此我不知道你将有多少运气使它运行与当前Visual Studio的版本。
可能最简单的创建OLE控件(.ocx)的选项是使用旧的Visual Basic 6.这里描述:
也可以在像C#这样的托管代码中写一个控件,但我认为这不是建议的 1 ,因为如果当前进程已经运行另一个版本的CLR,可能会导致冲突(到目前为止,只有一个版本的CLR可以存在于进程中,.NET 4.0将引入并行执行CLR)。我找到了以下教程:
I am looking for some references on how to implement the following feature:
ability to embed objects (e.g. diagrams) into word processors and being able to edit them in their respective "mother" application
For example, MS Word and Visio work like this together, allowing the user to easily edit/tweak the diagrams after adding them to the word processor.
I am interested in 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 references, examples, books on how to approach this?
PS: Every time I try to search MSDN for this, I get the impression I am in the wrong place. =(
Since OLE is an almost pre-historic technology (still of use) you have to dig a bit deeper in MSDN. The article linked below describes a sample application that can be embedded into container applications such as IE, Word, or OpenOffice. The sample is based on VC6, so I don't know how much luck you will have to get it running with current versions of Visual Studio.
Probably the most simple option to create an OLE control (.ocx) is to use the old Visual Basic 6. This is described here:
It is also possible to write a control in managed code like C#, but I assume this is not recommended1 as it might lead to conflicts if the current process is already running another version of the CLR (Up to now, only one version of the CLR can exist in a process, .NET 4.0 will introduce side-by-side execution of the CLR). I found the following tutorial:
1See the warning at the bottom of this article by Andrew Whitechapel.
这篇关于将对象嵌入到Microsoft Word和OpenOffice Writer中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!