使用Powerpoint vba调整图片大小

使用Powerpoint vba调整图片大小,vba,powerpoint,image-resizing,Vba,Powerpoint,Image Resizing,我正在尝试使用powerpoint vba调整已从Excel粘贴到powerpoint中的图片的大小 我的密码是: ActivePresentation.Slides(9)。选择 Application.ActiveWindow.View.PasteSpecial数据类型:=ppPasteEnhancedMetafile 这部分很好,我不知道如何在下一步调整图片的大小。我不熟悉使用powerpoint vba 任何帮助都将不胜感激。 永远不要选择任何东西,除非你绝对必须选择,而且你很少必须选择。

我正在尝试使用powerpoint vba调整已从Excel粘贴到powerpoint中的图片的大小

我的密码是:

ActivePresentation.Slides(9)。选择
Application.ActiveWindow.View.PasteSpecial数据类型:=ppPasteEnhancedMetafile

这部分很好,我不知道如何在下一步调整图片的大小。我不熟悉使用powerpoint vba

任何帮助都将不胜感激。

  • 永远不要选择任何东西,除非你绝对必须选择,而且你很少必须选择。。改为获取对形状的引用

  • 实际上,您不需要查看幻灯片就可以操纵该幻灯片上的形状

  • 使用形状的.Top、.Left、.Height和.Width属性设置其位置和大小

例如:

Dim oSh As Shape

Set oSh = ActivePresentation.Slides(9).Shapes.PasteSpecial(ppPasteEnhancedMetafile)(1)
' .PasteSpecial returns a ShapeRange; the (1) at the end of the line above
' returns the first shape in the range. W/o that, you get a type mismatch error
' from trying to assign a range to a shape

With oSh
   ' Set position:
  .Left = 0
  .Top = 0
   ' Set size:
  .Height = 100
  .Width = 200
End With
  • 永远不要选择任何东西,除非你绝对必须选择,而且你很少必须选择。。改为获取对形状的引用

  • 实际上,您不需要查看幻灯片就可以操纵该幻灯片上的形状

  • 使用形状的.Top、.Left、.Height和.Width属性设置其位置和大小

例如:

Dim oSh As Shape

Set oSh = ActivePresentation.Slides(9).Shapes.PasteSpecial(ppPasteEnhancedMetafile)(1)
' .PasteSpecial returns a ShapeRange; the (1) at the end of the line above
' returns the first shape in the range. W/o that, you get a type mismatch error
' from trying to assign a range to a shape

With oSh
   ' Set position:
  .Left = 0
  .Top = 0
   ' Set size:
  .Height = 100
  .Width = 200
End With