Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2015, 11:16 AM
phamh phamh is offline Multi line for AddTextBox Windows 7 64bit Multi line for AddTextBox Office 2013
Novice
Multi line for AddTextBox
 
Join Date: Oct 2014
Posts: 13
phamh is on a distinguished road
Default 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
Attached Images
File Type: jpg multiline_addTextBox.JPG (12.6 KB, 11 views)

Last edited by phamh; 02-27-2015 at 09:14 PM. Reason: Add attachment
Reply With Quote
  #2  
Old 03-02-2015, 09:58 PM
phamh phamh is offline Multi line for AddTextBox Windows 7 64bit Multi line for AddTextBox Office 2013
Novice
Multi line for AddTextBox
 
Join Date: Oct 2014
Posts: 13
phamh is on a distinguished road
Default

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
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi line for AddTextBox anchor addtextbox to new page Deltaj Word VBA 1 12-05-2014 01:56 AM
Multi line for AddTextBox 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

Other Forums: Access Forums

All times are GMT -7. The time now is 12:03 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft