vba 用vba创建powerpoint形状

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19010299/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 23:30:08  来源:igfitidea点击:

Create powerpoint shape with vba

vbapowerpointpowerpoint-vba

提问by Edward Armstrong

I am trying to create a VBA that creates a green up arrow with no border. Currently the VBA is creating a green arrow with a black border. Can anyone help me out with this? My code is below. I tried shp.Line.Fill.ForeColor.RGB = RGB(137, 143, 75)and was still getting the black outline.

我正在尝试创建一个 VBA,它创建一个没有边框的绿色向上箭头。目前,VBA 正在创建一个带有黑色边框的绿色箭头。谁能帮我解决这个问题?我的代码如下。我试过 shp.Line.Fill.ForeColor.RGB = RGB(137, 143, 75) 并且仍然得到黑色轮廓。

Thanks in advance.

提前致谢。

Sub Up_Arrow()     
    Dim i As Integer     
    Dim shp As Shape     
    Dim sld As Slide

    Set sld = Application.ActiveWindow.View.Slide
    Set shp = sld.Shapes.AddShape(35, 10, 10, 5.0399, 8.6399)    
    shp.Fill.ForeColor.RGB = RGB(137, 143, 75)      
    shp.Fill.BackColor.RGB = RGB(137, 143, 75)              
End Sub

Update: Probably not the most sophisticated way to do it but following line of code worked.

更新:可能不是最复杂的方法,但以下代码行有效。

shp.Line.ForeColor.RGB = RGB(137, 143, 75)

shp.Line.ForeColor.RGB = RGB(137, 143, 75)

采纳答案by sam092

shp.Line.Visible = msoFalse

is what you need.

是你所需要的。

In fact, you can obtain the code required by recording a macro :)

其实你可以通过录制一个宏来获取所需的代码:)

回答by ZebraOnWheels

You can make the line invisible this way:

您可以通过这种方式使线条不可见:

shp.Line.Visible = MsoFalse