Autofit text to placeholder using vbscript

P

Paddy

I am scripting some features to powerpoint and I can not figure out how to
set the autofit text to placeholder in script.

Can anyone help?
 
P

Paddy

Steve,

I was hoping there was a way to call to the feature that autofits text to
placeholder...but I have at this time counted the number of paragraph marks
and set the font size to accomodate the greater amount of content.

Do you see an more elegant solution?

Paddy
 
J

John Wilson

You can do this in 2007 but in earlier versions I'm pretty sure this setting
is stored in a reg key so you would have to write code to access the key
which is at
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\PowerPoint\Options\AutoFitTExtBody


Amazing PPT Hints, Tips and Tutorials-
http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
P

Paddy

Steve,

Yes! I did try recording a macro and it would not record the action taken.
I think John is right this is not easily accessible in the version I am
running.
 
P

Paddy

John,

Thanks! I have a decent work around for now and I will look into whether I
can set the registry value.

Paddy
 
S

Steve Rindsberg

Yes! I did try recording a macro and it would not record the action
taken.
I think John is right this is not easily accessible in the version I am
running.

<bending_over>
OK. You're awarded one swift kick at the target presented here.
</bending_over>

My mistake ... I was thinking of autosizing the shape to the text, not the
opposite.

If you're scripting PPT from an external app and you're starting PPT up
yourself, you could change the AutoFit settings by making changes to the
registry. Look at what happens in
HKCU\Software\Microsoft\Office\X.X\PowerPoint\Options as you change the
AutoFit settings manually then refresh the Regedit window.

X.X = 11.0 in this case (2003) but will vary with other versions.

If you have to work within PPT/VBA, this won't work. PPT loads these
settings at startup, so changes after that won't have any effect. You'll
probably have to use SendKeys to do the deed dirtily.


 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top