Hi Steve
You can use the Characters method:
Sub Test()
With Worksheets("Sheet1").Shapes("Text Box 1").TextFrame
..Characters.Text = "sample text"
'the word "text" in bold (need to count characters)
..Characters(8, 4).Font.Bold = True
End With
End Sub
HTH
Cordially
Pascal
"StevenD72 via OfficeKB.com" <u46061@uwe a écrit dans le message de news:
89f90c9668b36@uwe...
I created a "textbox" on my worksheet that I fill with data from another
worksheet. The textbox is a "shape". I am able to place text in the box
without any problems, however I want a few of the items to be BOLD when I
place them. I do not want all the text to be that way.
Is there a way to do this within VB?
I can select the information with the mouse and press the BOLD button on
the
commandBar and it does work, so I am guessing there should be a way to do
this in VB. I am trying to "paste" the items that came from the worksheet
as
BOLD.
***some of the code has been removed because it was more than needed.***
Thanks Again.
Steve
'-----------------------------------------------------------------------------
Sub Fill_Letter()
Dim ws As Worksheet
Dim ws2 As Worksheet
Set ws = Worksheets("Billing Letter")
Set ws2 = Worksheets("Billing Statement")
'Get Info from Billing Statement
Con_Name = ws2.Cells.Range("D12").Value
Con_Comp = ws2.Cells.Range("E11").Value
Con_Addrs = ws2.Cells.Range("C13").Value
Con_City = ws2.Cells.Range("B14").Value
'Place Header on page
ws.DrawingObjects("HeaderBox").Select
Selection.Characters.Text = "THIRD DISTRICT CHIEF'S ASSOCIATION"
'Place main letter on Page
ws.DrawingObjects("Textbox2").Select
Sdate = FormatDateTime(Date, vbLongDate) 'Gets Todays Date
Selection.Characters.Text = Sdate & Chr(10) & Chr(10) _
& Con_Name & Chr(10) & Con_Comp & Chr(10) _
& Con_Addrs & Chr(10) & Con_City & ", " _
& Con_State & " " & Con_Zip & Chr(10) & Chr(10) _
& "This statement is for services provided by the Hazardous Materials
Team"
End Sub
--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200809/1