在 PowerPoint 2016 中调整图像大小的 VBA 代码

标签 vba image-resizing powerpoint-2016

我在学习 VBA 的第一周,我正在寻找一个 VBA 代码,它可以帮助我调整粘贴到 PowerPoint 2016 中的图片的大小和位置。所需的图片格式详细信息如下:

尺寸
- 高度 = 3.39"
- 宽度 = 6.67"
- 旋转 = 0
- 比例高度 = 62%
- 刻度宽度 = 62%
- 纵横比 = 锁定
- 相对于原图大小=true

位置
- 水平位置 = 0
- 左上角
- 垂直位置 = 2.06
- 左上角

如有任何帮助,我们将不胜感激。

最佳答案

下面是对我有用的代码。感谢支持。

Sub ResizeAll()
For Each tSlide In ActiveWindow.Presentation.Slides
    tSlide.Select
    With tSlide.Shapes.Item(1)
    'assume a blank slide with one image added only
        .Select
        .Height = 72 * 3.39
        .Width = 72 * 6.67
    'algin middle (Horizontal Center)
        .Left = 0
        .Top = ActivePresentation.PageSetup.SlideHeight / 3.25
    End With
Next
End Sub

关于在 PowerPoint 2016 中调整图像大小的 VBA 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50844525/

相关文章:

image-processing - 使用双线性插值调整图像大小时结果不匹配

objective-c - resizableImageWithCapInsets : resizingMode: UIImageResizingModeTile isn't working

tfs - TF86001 : Team Foundation was unable to load the Office Add-in

vba - excel vba代码几次运行后始终损坏我的文件

excel - 运行时错误 76 找不到路径

excel - 从 Outlook 引用和访问 Excel

excel - 具有多个 'past due' 项的 MsgBox

php - 如何使用 Codeigniter 调整图像大小