Share via

web browser control in powerpoint

Anonymous
2017-04-30T09:19:15+00:00

I have inserted a web browser control into a powerpoint presentation (Powerpoint 2013)

Running in slide show mode the web browser control shows the contents of the directory that the powerpoint presentaion resides in.

Is there a way to set the web browser control to browse to another location?  I can see how to do this with a macro attached to a button on the same slide for example  - but I cannot see if there is a property or method I can use so that the web wbrowser control is already set to browse to a given URL as it displays in the slide show?

many thanks for an suggestions.

steve

Microsoft 365 and Office | PowerPoint | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2017-05-01T11:30:04+00:00

You could use that method (I wrote that page) like this maybe:

Sub OnSlideshowPageChange(SW As SlideShowWindow)

Dim osld As Slide

Dim oshp As Shape

Dim oMWB As Object

Set osld = SW.View.Slide

For Each oshp In osld.Shapes

If oshp.Type = msoOLEControlObject Then

If oshp.OLEFormat.ProgID = "Shell.Explorer.2" Then _

Set oMWB = oshp.OLEFormat.Object

Exit For

End If

Next

If Not oMWB Is Nothing Then _

oMWB.Navigate ("Http:\www.google.com")

End Sub

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

Answer accepted by question author

Anonymous
2017-05-01T11:59:54+00:00

It wouldn't but you can add a tag to each webrowser with the URL fairly easily.

Sub addTag()

ActiveWindow.Selection.ShapeRange(1).Tags.Add "URL", "http:\www.Google.co.uk"

End Sub

and then

oMWB.Navigate oshp.Tags("URL")

Was this answer helpful?

0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-05-01T11:43:32+00:00

    Thank you for this additional info,  I will give it a try, though I am not sure if the way this is coded will allow me to set different URLs for each Web Browser control encountered in a slide presentation? Which is essentially what I would like to do.

    steve

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2017-04-30T17:36:46+00:00

    thank you for that.

    Though the artice you point to uses an action button, which I had figured out how to do.

    What I needed was to understand how to set the URL automatically if you like, so as the slide is displayed the web browser control on it already displays a selected URL

    In the mean time I found the following article and have used the approach outlined there, I think my mistake was to think about the wrong object, the control, instead of the slide.

    http://www.vbaexpress.com/kb/getarticle.php?kb\_id=983

    With the above approach I can use the Navigate method to set the URL that opens in the web browser control on a specified slide.

    However, I would still be interested to know if there are other perhaps better approaches.

    thanks you again

    steve

    Was this answer helpful?

    0 comments No comments
  3. Steve Rindsberg 99,166 Reputation points MVP Volunteer Moderator
    2017-04-30T16:42:10+00:00

    Was this answer helpful?

    0 comments No comments