如何在 [vba] [powerpoint] 中为图像添加彩色边框

How to add color border to image in [vba] [powerpoint]

我需要为我在 power point 演示文稿中的不同图像添加边框,我也在寻找如何将图像发送到字母后面的背景。谁能帮帮我

Sub ajustar2()

'imagenes  segunda diapo'

Set imagen1 = ActivePresentation.Slides(2)
imagen1.Shapes.AddPicture FileName:="D:\I\P\h.png", LinkToFile:=msoTrue, SaveWithDocument:=msoTrue, _
    Left:=10, Top:=75, Width:=433, Height:=330
    
Set imagen2 = ActivePresentation.Slides(2)
imagen2.Shapes.AddPicture FileName:="D:\I\P\d.png", LinkToFile:=msoTrue, SaveWithDocument:=msoTrue, _
    Left:=463, Top:=75, Width:=484, Height:=330

'imagenes  tercera diapo'

Set imagen1 = ActivePresentation.Slides(3)
imagen1.Shapes.AddPicture FileName:="D:\I\P\h.png", LinkToFile:=msoTrue, SaveWithDocument:=msoTrue, _
    Left:=10, Top:=75, Width:=433, Height:=330
    
Set imagen2 = ActivePresentation.Slides(3)
imagen2.Shapes.AddPicture FileName:="D:\I\P\v.png", LinkToFile:=msoTrue, SaveWithDocument:=msoTrue, _
    Left:=463, Top:=75, Width:=484, Height:=330
    
    ActivePresentation.Slides(2).Select
    Selection.ShapeRange.ZOrder msoSendToBack

End Sub

使用图片作为形状对象并编辑它的属性

Sub ajustar2()
Dim imagen1 As Slide, pic As Shape
Set imagen1 = ActivePresentation.Slides(1)
Set pic = imagen1.Shapes.AddPicture(FileName:="D:\INFORMES\PILAS\hazard.png", _
            LinkToFile:=msoTrue, SaveWithDocument:=msoTrue, Left:=10, Top:=75, _
            Width:=433, Height:=330)
With pic
.Line.Weight = 5
.Line.ForeColor.RGB = RGB(255, 0, 0) 'choose RGB color combination
.ZOrder (msoSendToBack)

End With
End Sub