#1
|
|||
|
|||
Multi line for AddTextBox
Hello,
I wonder if anyone can help me on this Let say my text looks like this: "ABC-123 Feb 2015 Mike Smith", how do I do to add character return to make looks like below: ABC-123 Feb 2015 Mike Smith I could use AddTextBox three times, but my customers want it to be in the same box, and they also want to color it and resize them differently. The final text should be look like this ABC-123 (blue, bold, 28pt) Feb 2015 (black, bold, 24pt) Mike Smith (black, bold, 10pt) Thank you so much in advance HP Last edited by phamh; 02-27-2015 at 09:14 PM. Reason: Add attachment |
#2
|
|||
|
|||
Sub Thing()
' Some setup to add a text box Dim oSl As Slide Dim oSh As Shape Set oSl = ActivePresentation.Slides(1) Set oSh = oSl.Shapes.AddTextbox(msoTextOrientationHorizontal , 0, 0, 500, 500) ' But add the tex like so ... with a CR/LF pair at the end of every line: oSh.TextFrame.TextRange.Text = "ABC-123" & vbCrLf & "Feb 2015" & vbCrLf & "Mike Smith" ' The shape's TextRange has a .Paragraphs collection that you can address ' a paragraph at a time. ' Note: there's also a .Lines collection With oSh.TextFrame.TextRange .Paragraphs(1).Font.Color.RGB = RGB(255, 0, 0) .Paragraphs(2).Font.Color.RGB = RGB(0, 255, 0) .Paragraphs(3).Font.Color.RGB = RGB(0, 0, 255) End With End Sub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
anchor addtextbox to new page | Deltaj | Word VBA | 1 | 12-05-2014 01:56 AM |
Multi-line text with formatting in a form | cellophane | Word | 2 | 10-04-2012 10:15 AM |
Multi Line Cell | DrDOS | Excel | 2 | 03-27-2012 01:16 AM |
Paragraphs vanishing in multi line cells | teknetia | Word Tables | 0 | 08-02-2009 10:50 PM |
Multi Line Bookmark | streng | Word | 3 | 07-13-2009 07:54 AM |