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!



Answer this question

How to insert my object into Word document?

  • Peter Moody

    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.

  • sydg

    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


  • Shridhark

    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

  • How to insert my object into Word document?