在powerpoint退出演示文稿后,让代码发挥作用。

问题描述 投票:0回答:1

用Powerpoint VBA缩放图表。将图形放大后,我需要代码返回到之前的图形。

示例:1

下面是运行演示文稿前的版本。

enter image description here

sample:2

运行演示文稿后,当我点击周期图时,借助代码进行缩放。

enter image description here

sample:3当你离开演示文稿时,它就变成了最终的样子。

enter image description here

示例:4让我关闭我想要的演示文稿后,回到第一个自动初始状态。

在这里输入图像描述

Powerpoint文件。

enter link description here

powerpoint-vba
1个回答
0
投票
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
© www.soinside.com 2019 - 2024. All rights reserved.