ShapeRange.TextEffect 屬性 (Project)
取得圖形範圍的文字格式設定屬性。 唯讀 的 TextEffectFormat。
語法
運算式。TextEffect
表達 代表 'ShapeRange' 物件的變數。
範例
下列範例會建立包含文字方塊圖案的圖案範圍、將文字圖文框中文字的前景色彩設定為紅色、將文字方塊圖案的前景色彩設定為黃色,然後使用 TextEffect 屬性來設定字型屬性。
如果圖案範圍中有一個以上的文字方塊圖案,則每個文字方塊的字型屬性都會隨之變更。
Sub FormatTextBox()
Dim theReport As Report
Dim textShape As shape
Dim reportName As String
Dim sRange As ShapeRange
reportName = "Textbox range report"
Set theReport = ActiveProject.Reports.Add(reportName)
Set textShape = theReport.Shapes.AddTextbox(msoTextOrientationHorizontal, 30, 50, 350, 80)
textShape.Name = "My text box"
textShape.TextFrame2.TextRange.Text = "This is a test. It's only a test. "
textShape.TextFrame2.TextRange.Characters.Font.Fill.ForeColor.RGB = &H2020CC
textShape.Fill.ForeColor.RGB = &H88CCCC
Set sRange = theReport.Shapes.Range(Array("My text box"))
With sRange.TextEffect
.FontName = "Courier New"
.FontBold = True
.FontItalic = True
.FontSize = 28
End With
End Sub
屬性值
TEXTEFFECTFORMAT
另請參閱
ShapeRange 物件Shape.TextEffect 屬性TextEffectFormat
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。