【问题标题】:Size and move a picture in powerpoint在 PowerPoint 中调整图片大小和移动图片
【发布时间】:2020-07-04 04:22:06
【问题描述】:

我有以下 VBA 代码,可让我将 excel 文件粘贴到 powerpoint 中。我工作,但粘贴后我还想调整它的大小(让它变小一点)并将它移动到右上角。

关于我应该如何更改下面的代码来完成此操作的任何建议?

亲爱的,

马克

 Sub OpenPPT()


Dim pptapp As PowerPoint.Application
Dim ppt As PowerPoint.Presentation
Dim slide As PowerPoint.slide
Dim shape As PowerPoint.shape

var2 = "C:\Documents and Settings\aa471714\Desktop\Presentation1.ppt"

Set pptapp = CreateObject("Powerpoint.Application")
Set ppt = pptapp.Presentations.Open(var2)
Set slide = ppt.Slides(1)
Set shape = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, 100, 100, 100, 100)

pptapp.Visible = True

With slide

.Shapes.Paste

End With

End Sub

【问题讨论】:

    标签: vba powerpoint


    【解决方案1】:

    而不是这个位:

    With slide
      .Shapes.Paste
    End With
    

    替换为:

    Set shape = slide.shapes.paste(1)
    With shape
       .Left = 100  ' or whatever
       .Width = 500 ' or whatever
    End With
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-07
      • 2021-05-07
      • 2020-07-04
      • 2015-12-15
      • 1970-01-01
      • 2012-02-22
      相关资源
      最近更新 更多