jlingle
01-12-2013, 05:43 AM
In PowerPoint 2010 I have a VBA program that reads text from a spreadsheet and inserts it into a template slide. The text pulled from the spreadsheet are different lengths. I want the text in the text box on the slide to adjust its font size so it fits the box. On the template slide I have checked ""Shrink text on overflow." When I type or paste text into the box by hand it shrinks on overflow as it should. However, when I populate the title box with the VBA code pulling text from the spread sheet, it does not re-size. Is there a way to set the template (or adjust the VBA) so the text will adjust to the title text box size?
The VBA code I have written to pull data from the spreadsheet and insert it into the title box is the following:
Application.Presentations(CurrentTMPF).Slides(CurrentTMPS).Shapes("Slide-Title").TextFrame.TextRange.Text = _
XLBookL.Sheets(NameOfTab).Range(cCats & CStr(CurrentQST + CatNum + 1)) & ": " & _
XLBookL.Sheets(NameOfTab).Range(cQsTxt & CStr(CurrentQST + CatNum + 1))
Thanks
The VBA code I have written to pull data from the spreadsheet and insert it into the title box is the following:
Application.Presentations(CurrentTMPF).Slides(CurrentTMPS).Shapes("Slide-Title").TextFrame.TextRange.Text = _
XLBookL.Sheets(NameOfTab).Range(cCats & CStr(CurrentQST + CatNum + 1)) & ": " & _
XLBookL.Sheets(NameOfTab).Range(cQsTxt & CStr(CurrentQST + CatNum + 1))
Thanks