DEV Community

Oscar Sun(孫守真字任真)
Oscar Sun(孫守真字任真)

Posted on

Answer: How to compress pictures as I paste them (Word for Windows)

Just call the CompressPics method is ok.

I have no idea of the SendKeys "%a%p~", True. Is this necessary?

Sub ResizeSelectedPicture()
    On Error GoTo errorHandler
    Application.ScreenUpdating = False
    With selection
        .PasteAndFormat (wdPasteDefault) 'Pastes in the content
        .Start = .Start - 1 'move the start back one postion to include

Top comments (0)