How to insert my object into Word document?

For example : I have a WinForm graph control. I want to insert a icon in a Word document so that when the user double click the icon, my program will launch and show the corresponding graph.

This looks like a problem related to OLE, but how can I make a WinForm app as a OLE Server? Could I use VSTO to solve this problem?

Thanks!

[334 byte] By [LeiJiang] at [2008-3-5]
# 1
Hi Lei,

The easiest approach is to add a winform button to the document and handle the button click event to open your graph control in the actions pane or a winform dialog. VSTO makes this very easy to do.

Thanks,

Paul Stubbs
Program Manager - VSTO

PaulStubbs at 2007-9-9 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 2
Paul,

That's not what I want. What I want is very like a OLE operation : user copy part of my graph from my graph control, paste into a Word document, when he later double click the graph, my program started and begin to edit the graph. However, I don't know how to implement a OLE server in WinForm application, I'd like to know if I can do this in VSTO.

Thanks!

Lei Jiang

LeiJiang at 2007-9-9 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 3
VSTO does not provide any of the plumbing required to allow using WinForms applications as OLE servers.

Although winform's UserControl control does implement some of the ActiveX interfaces I have never seen any support in WinForms for your scenario.

MishaShneerson at 2007-9-9 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...