Consulting

Results 1 to 7 of 7

Thread: PictureWrapType equivalent in Word 2000?

  1. #1

    PictureWrapType equivalent in Word 2000?

    Hiya,

    I am using some VBA code to set the picturewraptype in some Word documents that are created from a template. The template was developed in Word 2003.

    I have a friend who has performed some testing for me using both Word 2002 and Word 2000. Works fine in Word 2002, errors out in Word 2000 with a compile error.

    I see now that picturewraptype was new in Word 2002 VBA. What I'm trying to insure is that pictures will be inserted in line with the text instead of floating. Anyone know what the equivalent VBA would be in Word 2000?

  2. #2
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Did you ever get an answer for this? I'd love to have your code. Specifically, select graphic, run macro, and the pic is formatted to in line with text.

    I've got 97 through 2003 here, and happy to test.
    ~Anne Troy

  3. #3
    Hi khagerman and Dreamboat,

    I've had this problem in Word 2000. I was copying pictures out of Adobe Illustrator and pasting them into Word.

    I had to paste them as an enhanced metafile (which comes in as floating), convert them to an 'inline shape' and then cut and paste again to get it in the correct spot!! Good to see they've fixed in Word 2002 on.

    Anyway, hope this code helps you guys. It was originally written from Excel, so you may be able to condense some of the .selection lines.

    [VBA] sub PasteClip(sBkMarkName as String, iHeight as Integer, iWidth as Integer)
    ActiveDocument.Bookmarks(sBkMarkName).Range.Select
    Selection.PasteSpecial Link:=False, DataType:=wdPasteEnhancedMetafile, DisplayAsIcon:=False

    'Need to resize to a consistant height and lock the aspect ratio
    Selection.ShapeRange.LockAspectRatio = msoTrue
    If iHeight <> 0 Then Selection.ShapeRange.Height = iHeight
    If iWidth <> 0 Then Selection.ShapeRange.Width = iWidth

    'Convert the shape to an inline shape
    Selection.ShapeRange.ConvertToInlineShape

    'Because the floating location moves when converted into an inline shape
    'we need to cut and paste to align it with the bookmark
    Selection.MoveRight wdCharacter, 1, wdExtend
    Selection.Cut
    ActiveDocument.Bookmarks(sBkMarkName).Range.Select
    Selection.Paste
    end sub [/VBA]

    Cheers,
    Andrew

  4. #4
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Andrew: Before you paste as an enhanced metafile (or whatever), place your cursor where you want the graphic to be. Then you don't have to cut/paste again to move it.
    ~Anne Troy

  5. #5
    Hi Dreamboat,

    Unfortunately, Word 2000 seems to paste the picture as a floating shape. When you convert it to an inline shape it moves in the document (I don't know if this is fixed in newer versions of word). Then you have to cut and paste it again to the correct spot. As far as I can see you can't paste it as an inline shape.

    Cheers,
    Andrew

  6. #6
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    "fixed"?? Heck no. I PREFER having it inline. Then I can treat it like a line of text, and use formatting on it, like space before and after, and even apply a style to it. No, you can't paste inline.
    ~Anne Troy

  7. #7
    I agree, I don't think I have every used a floating picutre type and can't see any reasons where it would be preferable.

Posting Permissions

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