Are you fitting the height or width or both?
I am also the same requirement. Need to fitting 'height and width ' based on the text length.
Thanks for any help.
Here are the general steps that I follow to do this:
1) Make the text frame very wide and very tall so that I am sure that all of the text fits.
2) Set a TextLoc at the end of the text frame's text.
3) Get the LocX and LocY of the TextLoc relative to the top of the text frame.
4) Adjust the Height and Width of the text frame based on the information in step 4.
Right now I am busy and can't provide the code to do this for free. If you have budget and and are interested in having me write this for you, please contact me off list. Thanks. -Rick