So, I have a shape I'm programatically generating, when it has a small amount of text, it looks like this:
If I add a huge amount of text however, it flows out of the shape, like so:
What I want to do is to hide the overflow and to force the text to start from the top of the shape (currently the text starts from a position higher than the top of the shape)
I haven't found much information about this so far, here is the code I'm using for the text inside the shape:
var shape = slide.Shapes.AddShape(MsoAutoShapeType.msoShapeRectangle, left, top, width, height);
var textRange2 = shape.TextFrame.TextRange.InsertAfter(description);
textRange2.Font.Size = 10;
shape.TextFrame.TextRange.Paragraphs().ParagraphFormat.Alignment = PpParagraphAlignment.ppAlignLeft;
shape.TextFrame.TextRange.Paragraphs().Font.Name = "Consolas";
shape.TextFrame.TextRange.Paragraphs().Font.Color.RGB = foregroundColor;
One last thing, I know I could just limit the string, but this would impose problems for the user. I want him to be able to resize the shape manually if there is too much text, so that's a no-go. Basically, I just want the equivalent of the css overflow:hidden rule.
One option for some users may be to use the following:
shape.TextFrame.AutoSize = PpAutoSize.ppAutoSizeShapeToFitText;
This will resize the shape to fit the text, there should also be an option to resize TEXT to fit the shape instead (resizing of fonts), I can't seem to find the function however.
Thanks guys