Consulting

Results 1 to 9 of 9

Thread: How to paste & then resize an image

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Mentor
    Joined
    Aug 2012
    Posts
    367
    Location

    How to paste & then resize an image

    hi, I Have borrowed one of John's magic modules to resize a shape, and tried to marry it with a paste command - end result is paste as enhanced metafile, then set position and size <not>

    I need to activate the shape to make it work under the current approach. How can I reliably identify it? or is there a better way?

    Sub PasteTable()
    Dim myShape As Object
        'paste excel table as enhanced metafile, then resize to full width
        ActiveWindow.Selection.SlideRange(1).Shapes.PasteSpecial ppPasteEnhancedMetafile
        Set myShape = ActiveWindow.Selection 'for debugging
        With ActiveWindow.Selection.ShapeRange(1)
       .LockAspectRatio = True
       .Top = 70 'points from top
       .Left = 10 'points from left
       .Width = 700 'points wide
        End With
    End Sub

    Thanks all.
    Last edited by Aussiebear; 04-09-2023 at 09:30 PM. Reason: Adjusted the code tags
    Remember: it is the second mouse that gets the cheese.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •