【问题标题】:How to change only line shape color in vba powerpoint如何在vba powerpoint中仅更改线条形状颜色
【发布时间】:2018-07-26 04:23:08
【问题描述】:

我的任务是在 Powerpoint VBA 中进行颜色填充。当我选择线条和框时,我只想更改线条并让框保持颜色。有没有办法只更改私有形状?

【问题讨论】:

    标签: vba colors powerpoint lines shapes


    【解决方案1】:

    以下代码将在 Powerpoint 2007 中将幻灯片 2 中的所有线条颜色更改为红色:

    Public Sub ChangeLineColours()
    
    Dim shp As Shape
    
    For Each shp In ActivePresentation.Slides(2).Shapes '<~~ Change '2' to whichever slide you want to loop through
        If shp.Type = msoLine Then
            shp.Line.ForeColor.RGB = RGB(255, 0, 0)
        End If
    Next shp
    
    End Sub
    

    【讨论】:

    • Gareth 谢谢你有帮助
    • 感谢您的回答,如何为图片添加彩色边框?
    • @Daxtrox 嗨,请从您要实现的目标开始一个新问题:)。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-10-21
    • 2023-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-11
    相关资源
    最近更新 更多