SN Ngaihte

I am using VSTO to create an addin for Word using C#. In my add-in I insert a video file as OLE-Object. When I double click on the inserted object, Windows Media Player starts playing my video file.

Now what I want is that I wanted to lauch my own video player and disable Windows media player as long as my add-in is used. But when my add-in is disabled or removed from MS-Word, my video file (inserted) should be played by Windows media player again.

Is there any suggestions If some one could help me I give my thanks in advance.

Regards

Suan Ngaihte




Re: Visual Studio Tools for Office How do I disable Windows Media Player in MS-Word Add-in

Cindy Meister

You might be able to do something with the WindowBeforeDoubleclick event. If your add-in is running and is trapping this event, then you can cancel the default action and invoke your app, instead, I think.




Re: Visual Studio Tools for Office How do I disable Windows Media Player in MS-Word Add-in

T. Siamginsuan Ngaihte

To Cindy Meister

I too think that may work. But I do not know how to cancel the default action. May you please tell/show me a bit...

Regards

Suan Ngaihte






Re: Visual Studio Tools for Office How do I disable Windows Media Player in MS-Word Add-in

Cindy Meister

Here's the information from the object model help; use the CANCEL parameter

<<Occurs when the editing area of a document window is double-clicked, before the default double-click action.

Private Sub object_WindowBeforeDoubleClick(ByVal Sel As Selection, Cancel As Boolean)

object An object of type Application declared with events in a class module. For more information about using events with the Application object, see Using Events with the Application Object.

Sel The current selection.

Cancel False when the event occurs. If the event procedure sets this argument to True, the default double-click action does not occur when the procedure is finished.>>






Re: Visual Studio Tools for Office How do I disable Windows Media Player in MS-Word Add-in

T. Siamginsuan Ngaihte

To Cindy Meister

I do not know how to thank you. Thank you very much and may God bless you. It works great and briliant.

Regards

Suan Ngaihte