M
Matt Kruse
I am populating a PPT file via a VB macro within Excel.
Everything works fine, except the following:
When I update the contents of a text box, then check its .height
property, I find that it does not reflect the new size of the textbox -
even though "resize autoshape to fit text" is checked in the textbox
shape!
For example, code like this:
set tmpObj = pptPresentation.Slides(1).Shapes(1)
height1 = tmpObj.height
tmpObj.TextFrame.TextRange.Text = "X" & vbCrLf & "Y" & vbCrLf & "Z"
height2 = tmpObj.height
When run normally, height2 has no value.
However, if I step through the code or if I put a MsgBox in there
somewhere, the values are correct.
Is it that Powerpoint is not updating the object fast enough for me to
inspect its properties? If so, is there some way for me to wait for it
to be ready, or to force it to "re-compute" the object so the height
property will be correct?
Thanks!
Matt Kruse
Everything works fine, except the following:
When I update the contents of a text box, then check its .height
property, I find that it does not reflect the new size of the textbox -
even though "resize autoshape to fit text" is checked in the textbox
shape!
For example, code like this:
set tmpObj = pptPresentation.Slides(1).Shapes(1)
height1 = tmpObj.height
tmpObj.TextFrame.TextRange.Text = "X" & vbCrLf & "Y" & vbCrLf & "Z"
height2 = tmpObj.height
When run normally, height2 has no value.
However, if I step through the code or if I put a MsgBox in there
somewhere, the values are correct.
Is it that Powerpoint is not updating the object fast enough for me to
inspect its properties? If so, is there some way for me to wait for it
to be ready, or to force it to "re-compute" the object so the height
property will be correct?
Thanks!
Matt Kruse