none
Resize text to fit in shape PowerPoint RRS feed

  • Question

  • I've seen many threads where shapes have been resized to fit text, but what about text that has been resized to fit in a shape?

    In Powerpoint there's the option to do so manually (underneath 'text options' -> 'Shrink text on overflow' while having a shape on focus), so surely there has to be a way to do this programatically.

    So has anyone been able to do this?

    Regards,
    Lucas

    Monday, May 20, 2013 3:47 PM

Answers

  • Apparently you can use set it this way:

    keeping in mind that var shape is of type Microsoft.Office.Interop.PowerPoint.Shape()

    Shape.TextFrame2.AutoSize = MsoAutoSize.msoAutoSizeTextToFitShape();

    Bear in mind that Shape.TextFrame.AutoSize accepts a value from the enumerable PpAutoSize and NOT from MsoAutoSize.

    PpAutoSize does not have the option to resize text to fit shape, but it does have the option to resize the shape to fix the text. Capish?

    • Marked as answer by Lucas Cordina Tuesday, May 21, 2013 11:41 AM
    Tuesday, May 21, 2013 11:41 AM

All replies

  • Apparently you can use set it this way:

    keeping in mind that var shape is of type Microsoft.Office.Interop.PowerPoint.Shape()

    Shape.TextFrame2.AutoSize = MsoAutoSize.msoAutoSizeTextToFitShape();

    Bear in mind that Shape.TextFrame.AutoSize accepts a value from the enumerable PpAutoSize and NOT from MsoAutoSize.

    PpAutoSize does not have the option to resize text to fit shape, but it does have the option to resize the shape to fix the text. Capish?

    • Marked as answer by Lucas Cordina Tuesday, May 21, 2013 11:41 AM
    Tuesday, May 21, 2013 11:41 AM
  • Hi Lucas,

    I'm glad to hear that your issue has been resolved.

    Thank you for sharing your solution is very helpful to other community members.

    Have a nice day.


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, May 21, 2013 1:43 PM
    Moderator