#1
|
|||
|
|||
autofit text to shape (msoShapeRectangle)
Hi...
I'm trying to autofit som text in a shape (a Rectangle), but I can only find autofit in ordinary textboxes. Can anybody help? Thanks in advance Code:
Set oshp = ActivePresentation.Slides(1).Shapes _ .addShape(msoShapeRectangle, left, top, width, height) ' left, top, width, height With oshp .Name = "Kategori" & countTwo End With With oshp.TextFrame.TextRange .Text = categories(countTwo) End With With oshp.Fill .ForeColor.RGB = RGB(200, 200, 200) .Visible = True End With |
#2
|
|||
|
|||
You may need to use TextFrame2 instead of TextFrame to access this new method
TextFrame2.AutoSize=msoAutoSizeTextToFitShape |
#3
|
|||
|
|||
Thanks John (Again ) works like a charm!
And again an additional question: Is there a way to set a minimum font-size and if it is reached (because of to much text in the box) then only display a certain number of characters? Ex. there is 100 characters in a textbox (100 x 100) and because of autofit the fontsize is reduced to 4 pt. Instead of that I would like the fontsize to be set to 7 pt. and only 70 characters displayed followed by "..." |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding text to auto shape and rotating | Hot Mumma | Word | 1 | 06-14-2011 05:15 PM |
Autofit Image to a Preset Cell | GarethHourihane | Drawing and Graphics | 6 | 06-02-2011 05:05 AM |
Custom shape in charts? | gilezajner | PowerPoint | 0 | 12-15-2010 02:21 AM |
Shape Objects | Space Cowboy | PowerPoint | 4 | 10-04-2010 07:14 PM |
Table Autofit Behavior Default | Henri Blits | Word Tables | 0 | 07-18-2006 03:49 PM |