【问题标题】:How to change powerpoint pictures in widescreen format如何更改宽屏格式的PowerPoint图片
【发布时间】:2014-02-06 17:19:42
【问题描述】:

嗨,我是 PowerPoint VBA 世界的新手,希望我的英语不会太差:我必须在 PowerPoint 2010 中解决以下问题:首先我更改为 16:9 宽屏格式,然后通过对于现在太大的每张图片,只需单击向上和向下箭头以缩放高度,即可从图片中更改尺寸对话框。图片将采用我之前在 4:3 演示中使用的正确格式。这很容易,但如果您必须更改 100 多张图片,则并非如此。我尝试了很多次,但没有任何效果。这是我的代码:

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,然后我的演示文稿没有任何问题。

有没有人可以帮助我。我希望以正确的方式表达我的问题;-)

提前致谢。

问候 琪琪

【问题讨论】:

  • 没有sh.ScaleHeight ActiveWindow.Presentation.PageSetup.SlideHeight, msoTrue 帮忙吗?

标签: vba powerpoint powerpoint-2010


【解决方案1】:

这对我有用

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

【讨论】:

  • 您好 Siddharth,非常感谢您的快速回复。不幸的是,它对我不起作用。演示文稿已正确更改,但图片消失了,我得到了一张绿色的大幻灯片。你知道发生了什么事吗?谢谢你在高级琪琪
  • and I got a big green slide 绿色通常与超自然活动有关?您是否向超自然专家展示了您的演示文稿:D 好吧,开个玩笑。能不能让我看看你的介绍。让我帮你查一下?如果是,则将其上传到 www.wikisend.com 并在此处分享链接。
  • 所以今天我必须工作,但明天我会将我的演示文稿发送给您。这只是一张幻灯片,上面有我的一张很棒的照片,以便在我用 100 张照片做这个之前看看一张照片发生了什么。感谢您的帮助。
  • with a great picture of mine 那我敢肯定它真的闹鬼 :P 无论如何,会等待你的链接。
  • 您好 Siddharth,我不知道 wikisend 平台,但我上传了我的 PowerPoint 演示文稿。我得到了这个 URL wikisend.com/download/397990 但如果我尝试查看我有一个 blanc 站点。那么,你知道我是否需要再等一会儿吗?使用此链接,然后告诉我您是否收到了该文件。琪琪
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多