Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create powerpoint shape with vba

Tags:

powerpoint

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)

like image 473
Edward Armstrong Avatar asked Jul 31 '26 03:07

Edward Armstrong


2 Answers

shp.Line.Visible = msoFalse

is what you need.

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

like image 174
sam092 Avatar answered Aug 01 '26 19:08

sam092


You can make the line invisible this way:

shp.Line.Visible = MsoFalse
like image 25
ZebraOnWheels Avatar answered Aug 01 '26 20:08

ZebraOnWheels



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!