粘贴并调整屏幕截图的大小

粘贴并调整屏幕截图的大小

我经常截取随机绘图的屏幕截图,我想使用宏调整它们的大小。我希望宏自动粘贴屏幕截图,然后调整其大小以适应 5.9 英寸的高度和 10 英寸的宽度。我当前使用的宏只要屏幕截图不是太高(高度),就可以完美运行,但我希望它调整到最接近的宽度(10)或高度(5.9),以先到者为准。有什么建议吗?

凯尔

Sub Resize()

  If ActiveDocument.Shapes.Count = 3 Then
    ActiveDocument.Shapes(3).Select
    Selection.shapeRange.Delete
  End If
  Application.ScreenUpdating = False
  Selection.Paste
  If ActiveDocument.InlineShapes.Count = 1 Then
    ActiveDocument.InlineShapes(1).ConvertToShape
  End If
  If ActiveDocument.Shapes.Count = 3 Then
    With ActiveDocument.Shapes(3)
      .WrapFormat.Type = wdWrapFront
      .LockAspectRatio = msoTrue
      .Height = InchesToPoints(5.9)
     ' .Width = InchesToPoints(10)

      .RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
     .RelativeVerticalPosition = wdRelativeVerticalPositionPage
      .Top = InchesToPoints(0.8) 
      .Left = wdShapeCenter 
    End With
  End If
  Application.ScreenUpdating = True
End Sub

相关内容