Is it possible to create an ActiveX control to embed into powerpoint for interactivity and create it using VSTO/C#

Re: Visual Studio Tools for Office VSTO, ActiveX, and Powerpoint


If so, does anyone have any source code of example controls

Re: Visual Studio Tools for Office VSTO, ActiveX, and Powerpoint

Geoff Darst - MSFT


You can create an Active X control using C#. To do this, you would need to create Runtime Callable Wrappers for every COM interface and type that you will need to implement an ActiveX control. Since Powerpoint will require a full OLE control, this will be non-trivial.

A less labor intensive approach would be to use the C++ MFC control project. This will do much of the heavy lifting for you and will greatly simplify your development effort. Once you have your control created, you could just use TLBIMP.EXE to generate an interop assembly containing the RCW's for you to interop with. I would recommend this approach.

If you do create a full managed ActiveX control implementation, you would probably not want to do this from within a VSTO customization (though you certainly could) unless there is some reason why your control should be so coupled.

ActiveX controls are a serious undertaking that require a great deal of code. You can certainly ask for a "sample", but I doubt you are going to get one (particularly a managed one). If you really want to write an ActiveX control without using MFC, your best bet would be to try to obtain a copy of Kraig Brockschmidt's "Inside OLE2". This will have sample code for most of the interfaces you'll need (albeit in native code).


Geoff Darst

Microsoft VSTO Team