VBA access to .Background broken in PPT2007/2010beta?

  • Thread starter Thread starter JKorth
  • Start date Start date
J

JKorth

Hello!

My PowerPoint VBA addin (written and tested in PowerPoint 2000-2003)
stopped working beginning with version 2007:

Whenever it calls one of the following commands

CurrentPresentation.SlideMaster.Background.Pickup
CurrentPresentation.TitleMaster.Background.Pickup
CurrentPresentation.Slides(I).Master.Background.Pickup
CurrentPresentation.Slides(I).Background.Pickup
Slide.Background.Visible

it shows the following runtime error:

Laufzeitfehler '-2147188160 (80048240)':
ShapeRange (unknown member) : Invalid request. This operation can't be
applied to a background shape.

When I go into the Debugger and add the Background object to the watch
list, it shows the error text
"<ShapeRange.* Invalid request. This operation can't be applied to a
background shape.>"
for most properties of the Background object (all except .Application
..AutoShapeType .BlackWhiteMode .Count .Creator .Fill .Shadow .Type .Item
1; and except .Parent and .MediaFormat which say "Anwendungs- oder
objektdefinierter Fehler" (=application or object defined error))

Any ideas how to get .Background working in newer PowerPoint versions?
Or are there any newer APIs for the same functionality?
Might it help to convert the VBA macros to a VB6 COM addin? (I guess:
probably not)
 
The following should work.

With osld
.FollowMasterBackground = msoFalse
.Background.Fill.UserPicture (picPath)
.Background.Fill.Visible = msoTrue
End With
 
Thanks alot, but I need to copy all .Background attributes - not just
set one background file - and some .Background.Fill.something-attributes
are only readonly.

(My addin should be able to process any presentation and "convert" it to
a XML file and a set of images; to create the images I copy the object
one by one into a new presentation - and there I need to have the
correct background.)

Am 10.03.2010 19:08, schrieb Edward:
 
Back
Top