Project) (ShapeRange.TextEffect 屬性

取得圖形範圍的文字格式設定屬性。 唯讀 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 支援與意見反應。