Edward Armstrong
Edward Armstrong

Reputation: 125

Create powerpoint shape with vba

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.

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)

Upvotes: 3

Views: 10958

Answers (2)

sam092
sam092

Reputation: 1335

shp.Line.Visible = msoFalse

is what you need.

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

Upvotes: 2

ZebraOnWheels
ZebraOnWheels

Reputation: 184

You can make the line invisible this way:

shp.Line.Visible = MsoFalse

Upvotes: 2

Related Questions