0

Please see the below link first,

Shapes.AddOLEObject method not working in PowerPoint 2013 (32bit and 64bit)?

Half the issue was solved there first. So, I am using the following code to add web browser control to PowerPoint slide,

Set oShp = oSld.Shapes.AddOLEObject(Left:=100, Top:=100, Width:=200, Height:=300, Classname:="Shell.Explorer", Link:=msoFalse)

The web browser control adds a PDF file.

The above code adds the OLEObject to the slide. But in PowerPoint 2010 the added shape is black as shown in below screen,

enter image description here

This is not the background color. It should be transparent like below image,

enter image description here

When I view the slide in Slide Mode (the PDF file is openned) and close it, the OLEObject (web browser control) becomes transparent (how it should be). In addition, in PowerPoint 2013 the OLEObject is added as shown below,

enter image description here

That little black square shows by red circle should not be there. This too when viewed in Slide Mode; the OLEObject (web browser control) becomes transparent.

In PowerPoint 2007 there are no issues. When the OLEObject is added, it is transparent.

So how to avoid this black color from the OLEObject in PowerPoint 2010 and 2013? When the OLEObject is added it must not show the black color. I think it is because of the web browser control. What do I need to do here?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Codename K
  • 890
  • 4
  • 23
  • 52

1 Answers1

0

You must navigate the WebBrowser to something to have any control on what is shown. For instance, about:blank, a custom page of yours or an empty PDF. Otherwise, it's just an empty container.

Alternatively, if you don't need navigation, you could embed Acrobat Reader directly, but I think you'll get more or less the same behavior regarding black/white rectangles until you open a document.

acelent
  • 7,965
  • 21
  • 39
  • But the same code worked without black color (on the OLEObject) in PowerPoint 2007? Only in 2010 and 2013 the issue is there. – Codename K Jan 10 '15 at 04:11