• Pasting a pic with attributes macro (Word 97 Sr2 win 95)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Pasting a pic with attributes macro (Word 97 Sr2 win 95)

    Author
    Topic
    #363238

    I am trying to write a macro that will paste a pic from the clipboard with some attributes set (no wrap, line width etc).

    My problem is that after the paste the pic is no longer selected and my atrribute settings then fail (no object).

    How can I keep the pic selected after the paste?

    I have got this far:

    Sub paste_pic()

    Selection.PasteSpecial DataType:=wdPasteMetafilePicture

    End Sub

    David

    Viewing 0 reply threads
    Author
    Replies
    • #553818

      I hope somebody else will come up with a more elegant solution … if not, this should work:

        Dim i
        
        i = ActiveDocument.Shapes.count
        Selection.PasteSpecial DataType:=wdPasteMetafilePicture
        ActiveDocument.Shapes(i + 1).Select

      cheersKlaus

      • #553819

        Klaus

        Many thanks – worked a treat.

        I vaguely knew I had to count the shapes but I could not get the syntax right – I’ve been beavering away on this since 0630 this morning…

        David

    Viewing 0 reply threads
    Reply To: Pasting a pic with attributes macro (Word 97 Sr2 win 95)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: