Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Location
    St Georges du Bois, Pays de la Loire
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

  2. #2
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    I hope somebody else will come up with a more elegant solution ... if not, this should work:
    <pre> Dim i

    i = ActiveDocument.Shapes.count
    Selection.PasteSpecial DataType:=wdPasteMetafilePicture
    ActiveDocument.Shapes(i + 1).Select</pre>


    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Klaus

  3. #3
    Star Lounger
    Join Date
    Mar 2001
    Location
    St Georges du Bois, Pays de la Loire
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

Posting Permissions

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