Insert WebBrowser Control in a slide of powerpoint via c#

Add-in Express™ Support Service
That's what is more important than anything else

Insert WebBrowser Control in a slide of powerpoint via c#
I want to impelement an add-in wich insert a widget in a slide 
farshid mirzagholi




Posts: 1
Joined: 2010-07-01
I want to impelement an add-in wich ins ert a widget in a slide whidget which load a html or aspx page contain a silverlight.
when widget add to page it has to load the page
I know there is a WebBrowser Control in power point which can show a web page but user must add a macro and call the macro t show the web page. I develop a simple add-in which is a button and must add this control to current slide and se t the Navigate property to my page
normaly I have to write this macro:
Sub go2URL()
Dim varURL As Variant

varURL = "http://www.microsoft.com"
Slide1.WebBrowser1.Navigate varURL
End Sub
but I want to do this at c#
I have this method and it works as well
private void MyButton_Click(CommandBarButton cmdBarbutton, ref bool cancel)
{
System.Windows.Forms.MessageBox.Show("MyButton was Clicked", "MyCOMAddin");
}
but I have to get the current slide and add this control to it
please somebody help it is realey urgent.
Posted 01 Jul, 2010 10:12:29 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Farshid,

You can add an OLE object to a PowerPoint presentation by using the http://msdn.microsoft.com/en-us/library/bb230698(office.12).aspx method. To get access to the added OLE object (WebBrowser in your case) you can use the
http://msdn.microsoft.com/en-us/library/bb251159(v=office.12).aspx collection and then the http://msdn.microsoft.com/en-us/library/bb230543(v=office.12).aspx property.
Posted 02 Jul, 2010 08:29:48 Top
Sanjay nikkam




Posts: 1
Joined: 2010-07-17
I also want to know how to get the current slide of PPT using C#.
Posted 17 Jul, 2010 16:58:02 Top
Andrei Smolin


Add-in Express team


Posts: 18842
Joined: 2006-05-11
Hi Sanjay,

Please have a look at http://stackoverflow.com/questions/2804020/how-can-i-find-the-current-edit-slide-in-powerpoint and http://skp.mvps.org/ppt00044.htm.

Actually, the best source of first-hand info is the help reference for the object model of an Office application.

Getting help on COM objects, properties and methods

To get assistance with host applications?Â?Ð?é objects, their properties, and methods as well as help info, use the Object Browser. Go to the VBA environment (in the host application, choose menu Tools | Macro | Visual Basic Editor or just press {Alt+F11}), press {F2}, select the host application in the topmost combo and/or specify a search string in the search combo. Select a class /property /method and press {F1} to get the help topic that relates to the object.



Andrei Smolin
Add-in Express Team Leader
Posted 19 Jul, 2010 03:41:39 Top