簡體   English   中英

從 vba 更改 powerpoint 藝術字的字體邊框的顏色和粗細

[英]change the color and thickness of the font border of a powerpoint wordart from vba

如何從 vba 更改 powerpoint 藝術字的字體邊框的顏色和粗細? 我正在嘗試 with.TextFrame.TextRange 但我找不到方法

我有一個舊的 web 頁面生成一個 powerpoint 文件,我想修改它包含的 wordart 中文本字母的邊框

您可以在 Powerpoint 中做的很多事情,您也可以在 Excel 中做(例如藝術字)。 因此,如果您有 Excel(或 Word),請在那里執行您想執行的操作並錄制宏以了解您需要更改的屬性。

可以通過TextFrame2.Characters設置文本的字符格式。 在您的情況下,更改Font.Line的屬性。

Dim slide As slide
For Each slide In ActivePresentation.Slides
    Dim sh As Shape
    For Each sh In slide.Shapes
        If sh.HasTextFrame Then
            With sh.TextFrame2.TextRange.Characters.Font.Line
                If .Visible Then  ' Prevent changing "normal" text
                    ' Adapt the following lines to your need
                    .ForeColor.ObjectThemeColor = msoThemeColorAccent2
                    .ForeColor.TintAndShade = 0
                    .ForeColor.Brightness = -0.25
                    .Weight = 1
                    .Transparency = 0
                End If
            End With
        End If
    Next
Next

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM