Project) (Shape.TextEffect 属性

获取形状的文本格式属性。 只读 TextEffectFormat。

语法

表达式。TextEffect

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

属性值

TEXTEFFECTFORMAT

另请参阅

形状对象ShapeRange.TextEffect 属性TextEffectFormat

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。