Does anyone know how to change the font of a textbox? I know how to change the font of all the text, but I am unsure how to change just part of the text's font.
For instance, let's say I have code:
Public Function CreateStateSummary()
Dim objWordApp As Word.Application
Dim objWord As Word.Document
Dim oSel As Word.Selection
Dim txtTitle As Word.Shape
Set objWordApp = CreateObject("Word.Application")
Set objWord = objWordApp.Documents.Add
Set oSel = objWord.Application.Selection
objWord.Application.Visible = False
Set txtTitle = objWordApp.ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 89, 69, 400, 25)
With txtTitle
With .TextFrame
.TextRange.Font.Name = "Arial"
.TextRange.Font.Bold = True
.TextRange.Font.Size = 18
.TextRange.Text = "TITLE Okay"
End With
End With
objWord.Application.Visible = True
End Function
"TITLE Okay" is the text in the textbox.
I want to keep "TITLE" as Arial, but change "Okay" to Times New Roman
Does anyone know how to do this? I really want to keep them both in the same textbox, otherwise I would make two different textboxes as a workaround.
Thank you all,
Modest
For instance, let's say I have code:
Public Function CreateStateSummary()
Dim objWordApp As Word.Application
Dim objWord As Word.Document
Dim oSel As Word.Selection
Dim txtTitle As Word.Shape
Set objWordApp = CreateObject("Word.Application")
Set objWord = objWordApp.Documents.Add
Set oSel = objWord.Application.Selection
objWord.Application.Visible = False
Set txtTitle = objWordApp.ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 89, 69, 400, 25)
With txtTitle
With .TextFrame
.TextRange.Font.Name = "Arial"
.TextRange.Font.Bold = True
.TextRange.Font.Size = 18
.TextRange.Text = "TITLE Okay"
End With
End With
objWord.Application.Visible = True
End Function
"TITLE Okay" is the text in the textbox.
I want to keep "TITLE" as Arial, but change "Okay" to Times New Roman
Does anyone know how to do this? I really want to keep them both in the same textbox, otherwise I would make two different textboxes as a workaround.
Thank you all,
Modest