Working with Shell.Explorer.2

motokent
motokent used Ask the Experts™
on
I am using Visual Studio 2010 for a PowerPoint add-in that adds a webbrowser control to each new slide.  I'm using the following walkthrough for adding a textbox as a guide:
http://msdn.microsoft.com/en-us/library/cc668192.aspx

The add-in code below correctly adds the webbrowser control, but now I need to know how to manipulate the control.  For instance, when the slide is viewed for the first time, navigate to "about:blank"
Public Class ThisAddIn
    Private Sub Application_PresentationNewSlide(ByVal Sld As PowerPoint.Slide) _
    Handles Application.PresentationNewSlide
        Dim IE As PowerPoint.Shape = Sld.Shapes.AddOLEObject(Left:=10, Top:=10, Width:=600, Height:=400, ClassName:="Shell.Explorer.2")

    End Sub
End Class

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
John WilsonCEO PowerPoint Alchemy

Commented:
You would need to add an event trap to the addin to detect the slide change event and use this to trigger code from  the SlideShownextSlide event

Author

Commented:
Can you show the simple example:  navigate to "about:blank"?

I've been struggling with this for a long time, and might be making simple mistakes.

Events in PowerPoint 2007 seem much different than in previous versions.
John WilsonCEO PowerPoint Alchemy

Commented:
Events are pretty similar in 2007 to earlier versions (there are a few new ones) but they are not easy to use in any version!

Can you post whatever you have tried as I have no idea how much you know.

Are you using a class module? (you need to)
Have you declared a WithEvents variable?
Have yo instantiated a public instance in Auto_Open?
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Author

Commented:
The attachment is a scaled-down example.  It uses a webbrowser control that I added manually (ActiveX control vs using the Visual Studio add-in).  The EventClassModule is a remnant from my goofing around.  I couldn't make anything work.

Author

Commented:
Your link is the most useful thing I've seen so far....  I need two things:  1.) class module, and 2.) add-in to make it auto initialize

Right?
John WilsonCEO PowerPoint Alchemy

Commented:
Yep

class module as part of the Add In

I don't work with  VSTO but that's what's needed in vba
John WilsonCEO PowerPoint Alchemy

Commented:
PS I don't see an attachment!

Author

Commented:
I don't think Experts-Exchange allowed the file extension pptm.  Here's the file without the extension. simpleExample

Author

Commented:
Please do two things:  1.)add whatever you need to add to "simpleExample" and post it, then 2.)tell me what the add-in should look like.  I know it might seem simple, but this simple stuff has been a stumbling block for me.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial