3
votes

I'm trying to figure out a macros for PowerPoint files that I export after language conversion through a CAT tool. In some of the language pairs the translated content will not fit into the source file text boxes due to the differences in the language lengths.

Therefore, the translated and exported PowerPoint files contain multiple shapes/text boxes that have some content outside of the visible areas of such shapes. I was wondering what is way to get the newly exported textual content within all shapes/text boxes in the exported PPTs files shrunk globally throughout the file to fit the original sizes of those shapes - only for those shapes when a content overflow occurs.

All I really need is a macros with IF text height/length is more than shape height/length THEN lower font size by one until text dimensions = shape dimensions. I am working in MS Office 15.

Thank you for your input!

1
It would be helpful if you posted the code you are currently using to attempt performing this task. If you haven't written anything yet, take a crack at it and update your question with the specific issue you are running into.tittaenälg
It came out to be pretty simple, in fact. My issue was that I had to only include those shapes that had a text frame with actual text. Otherwise, the macros would shrink to fit all shapes even with an empty text frame.Ilia Shifrin
So are you good to go or do you still have questions that need answering?Steve Rindsberg
We are good, thank you!Ilia Shifrin

1 Answers

4
votes

Could you use the AutoSize property of the shape's TextRange and leave PowerPoint to automatically shrink the text based on the content because the fit will depend in the font face, size and style properties? You can do this with the following property:

oShp.TextFrame2.AutoSize = msoAutoSizeTextToFitShape