Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paste picture from clipboard then resize width?

Status
Not open for further replies.

KristianDude

Technical User
Mar 18, 2016
65
US
Hi everyone.. is there a simple way to paste a picture in a word document that already has inlineshapes and set the size of the width?.. here is the code that I am using to paste but can't figure out how to alter the width of the image being pasted??

Code:
        Selection.PasteAndFormat (wdPasteDefault) 'Pastes in the content
 
Try something based on:
Code:
Sub Demo()
With Selection
  .PasteAndFormat (wdPasteDefault) 'Pastes in the content
  .Start = .Start - 1 'move the start back one postion to include the image
  If .InlineShapes.Count = 1 Then
    'resize the image
    With .InlineShapes(1)
      .Width = InchesToPoints(3)
      .Height = InchesToPoints(2)
      .LockAspectRatio = True
    End With
  End If
End With
End Sub

Cheers
Paul Edstein
[MS MVP - Word]
 
Pretty certain we covered this in thread707-1763285 (and related threads)
 
Thanks guys. I think this closes out this thread. Paul, this definitely works for this question. Strongm, that post is very robust. I just need a simple resize for the imported image.. but I know we are now discussing this in the original post here Link. Thanks fellas

Kristian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top