標題幾乎說明了一切,但爲了使它更清楚一點,說我想創建一個文本框通過VBA說:「這個文本應該是字體大小爲24,這個文本應該是字體大小20。「在同一個文本框中使不同的單詞有不同的字體大小使用VBA
現在,我正在使用自己的函數來創建下面的文本框。歡呼,並感謝您的幫助!
Sub textBox(textBoxText As String)
Dim myTextBox As Shape
With ActiveWindow.Selection.SlideRange
Set myTextBox = .Shapes.AddTextbox _
(Orientation:=msoTextOrientationHorizontal, Left:=153, Top:=50, _
Width:=400, Height:=100)
myTextBox.TextFrame.TextRange.Text = textBoxText
myTextBox.TextFrame.TextRange.Paragraphs.ParagraphFormat.Alignment = ppAlignCenter
myTextBox.TextFrame.TextRange.Font.Bold = msoTrue
myTextBox.TextFrame.TextRange.Font.Name = "Arial (Headings)"
End With
End Sub
我相信你需要使用RichTextBox或兩個文本框來實現這一點。 – 2015-03-31 19:41:38