gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 07:15:37 30 4
gpt4 key购买 nike

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

Sub ajustar2()

'imagenes segunda diapo'

Set imagen1 = ActivePresentation.Slides(2)
imagen1.Shapes.AddPicture FileName:="D:\INFORMES\PILAS\hazard.png", LinkToFile:=msoTrue, SaveWithDocument:=msoTrue, _
Left:=10, Top:=75, Width:=433, Height:=330

Set imagen2 = ActivePresentation.Slides(2)
imagen2.Shapes.AddPicture FileName:="D:\INFORMES\PILAS\desplazamiento.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:\INFORMES\PILAS\hazard.png", LinkToFile:=msoTrue, SaveWithDocument:=msoTrue, _
Left:=10, Top:=75, Width:=433, Height:=330

Set imagen2 = ActivePresentation.Slides(3)
imagen2.Shapes.AddPicture FileName:="D:\INFORMES\PILAS\velocidad.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

关于vba - 如何在 [vba] [powerpoint] 中为图像添加颜色边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68788075/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com