想批量的修正PPT中所有图片的大小和位置-----在线等!!!!!!!!
各位大侠,本人想批量的修正PPT中所有图片的大小和位置,写了以下代码,但是提示出错,因在PPT中第一次使用VBA,不是很了解,请指点!谢过了!~在线等!!!!!!!!!!!!
Sub adjust()
Dim mySlide As Slide
Dim myShape As Shape, i_Temp As Integer
On Error Resume Next
For Each mySlide In ActivePresentation.Slides
For Each myShape In mySlide.Shapes
If myShape.Type = msoPicture Then
With myShape
.Left 5#
.Top 4.25
.Height = 396.75
.Width = 509#
End With
End If
Next
Next
End Sub
With myShape
.Fill.Transparency = 0#
.Height = 28.38
.Width = 28.38
.Left = 28.25
.Top = 28.25
End With
试着改成这样子 这样没有什么改变,不过谢谢了! 谁能帮帮我!~!~!~!继续顶起!继续在线等!!!! 楼主,这个问题你有解决了吗?能否告知?我也遇到了同样的问题。。。 Sub setpic()
Dim sld As Slide, sh As Shape
For Each sld In ActivePresentation.Slides
For Each sh In sld.Shapes
If sh.Type = msoPicture Then
With sh
.Left = 180
.Top = 100
.Height = 400
End With
End If
Next
Next
Set sld = Nothing
Set sh = Nothing
End Sub .Left 5#
.Top 4.25
添两个等号就可以了
.Left =5#
.Top =4.25
页:
[1]