如何更改宽屏格式的PPT图片 [英] How to change powerpoint pictures in widescreen format
问题描述
我是 PowerPoint VBA 世界的新手,希望我的英语不会太差:我必须在 PowerPoint 2010 中解决以下问题:首先我更改为 16:9 宽屏格式,然后我通过到每张现在太大的图片,只需单击缩放高度的向上和向下箭头即可从图片中更改大小对话框.图片将采用我之前在 4:3 演示中使用的正确形式.这很容易,但如果您必须更改 100 张以上的图片,则不然.我尝试了很多次,但没有任何效果.这是我的代码:
Hi I'am a Newbee in the world of PowerPoint VBA and hope my english is not too bad: I have to solve the following problem in PowerPoint 2010: First I change into the 16:9 widescreen format, then I go through to every picture which are now too big and change with size-dialog box from the picture only by clicking the up and down arrow for scaling height. The picture will be in the right form which I used before in the 4:3 presentation. That is easy but not if you have to change more then 100 of pictures. I tried so many times but nothing works. Here is my code:
Sub ChangePictures()
Dim sld As Slide
Dim sh As Shape
Dim meinShHeight As Double
ActivePresentation.PageSetup.SlideSize = 15
For Each sld In ActivePresentation.Slides
For Each sh In sld.Shapes
'If sh = msoLinkedOLEObject Or msoTextBox Then
If sh.Type = msoPicture Then
'meinShHeight = sh.ScaleHeight.Value
'sh.ScaleHeight meinShHeight, msoScaleFromTopLeft
sh.LockAspectRatio = msoTrue
With tSlide.Shapes.Select
.Height = ActiveWindow.Presentation.PageSetup.SlideHeight
.Width = ActiveWindow.Presentation.PageSetup.SlideWidth
End With
'sh.ScaleHeight 1.75, msoTrue
'sh.ScaleHeight -1.75, msoTrue
End If
'End If
Next
Next
End Sub
也许在 VBA 中不可能使用这种上下箭头技巧?不幸的是,我无法使用 PowerPoint 2013,然后我的演示文稿没有任何问题.
Perhaps it is impossible to use this up and down arrow trick in VBA? Unfortunately I cannot use PowerPoint 2013 then I didn't have any problem with my presentation.
有谁能帮帮我.我希望以正确的方式表达我的问题;-)
Is there anybody who can help me. I hope to express my problem in the right way ;-)
提前致谢.
问候琪琪
推荐答案
这对我有用
Sub ChangePictures()
Dim sld As Slide
Dim sh As Shape
ActivePresentation.PageSetup.SlideSize = 15
For Each sld In ActivePresentation.Slides
For Each sh In sld.Shapes
If sh.Type = msoPicture Then
With sh
.LockAspectRatio = msoTrue
.ScaleHeight ActiveWindow.Presentation.PageSetup.SlideHeight, msoTrue
.ScaleWidth ActiveWindow.Presentation.PageSetup.SlideWidth, msoTrue
End With
End If
Next
Next
End Sub
这篇关于如何更改宽屏格式的PPT图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!