Consulting

Results 1 to 2 of 2

Thread: Pasting Image inside Table and Resize Image Not Working

  1. #1

    Pasting Image inside Table and Resize Image Not Working

    I use the code listed at the end of this post to paste images into Word and resize them. It works fine EXCEPT when I try to use it inside a table cell. When it executes inside a cell, the image is pasted but not resized.

    I suspect that the Selection.Start = .Start - 1 is the problem but I don't know how to fix for this issue.

    Any help would be greatly appreciated!

    Sub FormatCard()
    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(2.54)
    .Height = InchesToPoints(3.47)
    .LockAspectRatio = True
    End With
    End If
    End With
    End Sub

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    3,607
    Location
    Cross-posted (and answered) at: http://www.msofficeforums.com/drawin...image-not.html
    Please read VBA Express' policy on Cross-Posting in item 3 of the rules: http://www.vbaexpress.com/forum/faq...._new_faq_item3
    Cheers
    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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