Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Praha
    Posts
    988
    Thanks
    56
    Thanked 105 Times in 90 Posts

    Scroll to the last picture ?

    Is it possible to write a macro (Word 2003 !) so that when a particular document opens it scrolls down to the last picture in a large table of pictures and puts the focus on that picture ?

    There is text throughout the table, including beyond the last picture.

    Thanks

  2. #2
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Praha
    Posts
    988
    Thanks
    56
    Thanked 105 Times in 90 Posts
    I think I have solved my own question with this code . . .

    Code:
    Sub LastPicture()
    Dim Picture As InlineShape
    Application.ScreenUpdating = False
    For Each Picture In ActiveDocument.InlineShapes
    Picture.Select
    Next Picture
    Application.ScreenUpdating = True
    End Sub
    Easier than I had imagined

  3. #3
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Code:
    Sub LastPicture()
    ActiveDocument.InlineShapes(ActiveDocument.InlineShapes.Count).Select
    End Sub
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  4. #4
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Praha
    Posts
    988
    Thanks
    56
    Thanked 105 Times in 90 Posts
    Thanks Paul, that's very neat !

    The last picture in the table isn't always the most recent. Which will show ?

  5. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Whether using your code or mine, it will always be the one in the last physical position. There is no reliable way of finding the most recent picture. Note also that your code and mine only work with inline shapes - not with pictures that have text-wrapping applied; you'd need different code for that and determining which picture is in the last physical position (as opposed to where it's anchored), adds a whole other layer of complexity.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  6. The Following User Says Thank You to macropod For This Useful Post:

    MartinM (2016-09-13)

  7. #6
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Praha
    Posts
    988
    Thanks
    56
    Thanked 105 Times in 90 Posts
    Thanks again Paul.

    Luckily its the last physical position I need, and I don't use text-wrapping with the pictures.

Posting Permissions

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