Shape.TextEffect (專案)

它會取得該形狀的文字格式屬性。 唯讀 TextEffectFormat

語法

表情文字效果

expression 一個用於表示 Shape 物件的變數。

範例

以下範例將文字框架中的前景色設為紅色,文字框形狀的前景色為黃褐色,然後使用 TextEffect 屬性來設定字型屬性。

Sub FormatTextBox()
    Dim theReport As Report
    Dim textShape As shape
    Dim reportName As String
    
    reportName = "Textbox report"
    
    Set theReport = ActiveProject.Reports.Add(reportName)
    Set textShape = theReport.Shapes.AddTextbox(msoTextOrientationHorizontal, 30, 50, 350, 80)
    
    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
    
    With textShape.TextEffect
        .FontName = "Courier New"
        .FontBold = True
        .FontItalic = True
        .FontSize = 28
    End With
End Sub

屬性值

文字效果格式

另請參閱

形狀物件ShapeRange.TextEffect 屬性TextEffectFormat

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應