Link to home
Start Free TrialLog in
Avatar of Bryce Bassett
Bryce BassettFlag for United States of America

asked on

PowerPoint VBA: How to manipulate slide background picture?

Hi,

I've built a fairly sophisticated dialog to let users of my PowerPoint add-in adjust the positioning, scale, and zoom of a slide background photo image.  

When I have set the background picture to tile as a texture (using currentslide.Background.Fill.TextureTile = True), then VBA lets me set the offset and scale, using these methods:
currentslide.Background.Fill.TextureHorizontalScale =
currentslide.Background.Fill.TextureVerticalScale =
currentslide.Background.Fill.TextureOffsetY =
currentslide.Background.Fill.TextureOffsetX =

User generated image
However, when the background picture is NOT set to tile as texture (currentslide.Background.Fill.TextureTile = False), I can't find the methods for VBA to control these Offset values?  
User generated image
Does anybody know where to find these methods?

Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

Can't you set Currentslide.Background.Fill.TextureTile = True, make the change, and set if back to False?

Mainly asking out of curiosity
Avatar of Bryce Bassett

ASKER

I would rather not tile the picture.  Based on my experiments, when PowerPoint brings in a picture background it automatically squeezes or stretches it as needed to fill the entire slide.  Turning on picture tiling discards this information and resets the picture to its original resolution, so you only see the upper left hand corner of it.

This is not tiled
User generated image
If you turn on tiling, this is what you see:
User generated image
The whole point of my dialog is a user who says to himself, "that's almost what I want, I just want to squeeze it or move it a little bit."  If I covert to a tiled picture, it changes it entirely.  Yes, they can use the controls to bring it back to what they started with, but I'm trying to avoid them needing to do that. I want to leave the picture untiled, so it's exactly the same as they were just looking at, then they use those 4 offset commands to do their minor tweak.

So the question remains...does VBA expose those 4 offset controls, for a non-tiled picture background, or not?

Thanks.

ASKER CERTIFIED SOLUTION
Avatar of John Korchok
John Korchok
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, John.

That was what I feared.  Thanks for this definitive answer. 

As you can tell, this relates to my earlier question.  That workaround of saving a surface image to a temporary file, then loading the temp file in as the background image, works nicely.