用Powerpoint VBA缩放图表。将图形放大后,我需要代码返回到之前的图形。
示例:1
下面是运行演示文稿前的版本。
sample:2
运行演示文稿后,当我点击周期图时,借助代码进行缩放。
sample:3当你离开演示文稿时,它就变成了最终的样子。
示例:4让我关闭我想要的演示文稿后,回到第一个自动初始状态。
Powerpoint文件。
Sub Yakınlaştır_1()
i = ActivePresentation.SlideShowWindow.View.Slide.SlideIndex
If ActivePresentation.Slides(i).Shapes("dnm").Width > 25 * 28.34646 Then
ActivePresentation.Slides(i).Shapes("dnm").Top = 11.4 * 28.34646
ActivePresentation.Slides(i).Shapes("dnm").Left = 2.47 * 28.34646
ActivePresentation.Slides(i).Shapes("dnm").Height = 6.12 * 28.34646
ActivePresentation.Slides(i).Shapes("dnm").Width = 12.71 * 28.34646
Else
ActivePresentation.Slides(i).Shapes("dnm").Top = 1.86 * 28.34646
ActivePresentation.Slides(i).Shapes("dnm").Left = 1.15 * 28.34646
ActivePresentation.Slides(i).Shapes("dnm").Height = 15.33 * 28.34646
ActivePresentation.Slides(i).Shapes("dnm").Width = 31.57 * 28.34646
ActivePresentation.Slides(i).Shapes("hehe").ZOrder msoBringToFront
ActivePresentation.Slides(i).Shapes("dnm").ZOrder msoBringToFront
End If
End Sub
Sub Yakınlaştır_2()
i = ActivePresentation.SlideShowWindow.View.Slide.SlideIndex
If ActivePresentation.Slides(i).Shapes("İl").Width > 25 * 28.34646 Then
ActivePresentation.Slides(i).Shapes("İl").Top = 11.4 * 28.34646
ActivePresentation.Slides(i).Shapes("İl").Left = 19.9 * 28.34646
ActivePresentation.Slides(i).Shapes("İl").Height = 6.19 * 28.34646
ActivePresentation.Slides(i).Shapes("İl").Width = 11.64 * 28.34646
Else
ActivePresentation.Slides(i).Shapes("İl").Top = 1.32 * 28.34646
ActivePresentation.Slides(i).Shapes("İl").Left = 1.13 * 28.34646
ActivePresentation.Slides(i).Shapes("İl").Height = 16.31 * 28.34646
ActivePresentation.Slides(i).Shapes("İl").Width = 30.7 * 28.34646
ActivePresentation.Slides(i).Shapes("hehe").ZOrder msoBringToFront
ActivePresentation.Slides(i).Shapes("İl").ZOrder msoBringToFront
End If
End Sub