So, I have a form that I programmatically generate, when it has a small amount of text, it looks like this:

If I add a huge amount of text, it follows from the form, for example:

I want to do this to hide the overflow and make the text start at the top of the form (currently the text starts at a position above the top of the form)
I have not yet found a lot of information about this, here is the code that I use for the text inside the form:
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;
Last, I know that I can just limit the line, but that would cause problems for the user. I want him to be able to resize the shape manually if there is too much text so that there is nothing. Basically, I just want the equivalent of css overflow: a hidden rule.
One option for some users may be as follows:
shape.TextFrame.AutoSize = PpAutoSize.ppAutoSizeShapeToFitText;
This will resize the form to fit the text, it should also be possible to resize the text to fit the form (change the font size), however I cannot find the function.
Thanks guys,
source share