+ Reply to Thread
Results 1 to 7 of 7

checking if shapes exist and grouping them

Hybrid View

  1. #1
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481
    If all items are required in order to group them then you can condense you code to

        On Error GoTo ERR_DOESNTEXIST
        grouped(2) = opa.ActivePresentation.Slides(activeslide).Shapes("star" & i).Name
        grouped(3) = opa.ActivePresentation.Slides(activeslide).Shapes("top" & i).Name
        grouped(4) = opa.ActivePresentation.Slides(activeslide).Shapes("picture" & i).Name
        ' group items
    
    ' code to group items
        
    ERR_DOESNTEXIST:
        Exit Sub
    Cheers
    Andy
    www.andypope.info

  2. #2
    Registered User
    Join Date
    06-16-2008
    Posts
    32
    Quote Originally Posted by Andy Pope View Post
    If all items are required in order to group them then you can condense you code to

        On Error GoTo ERR_DOESNTEXIST
        grouped(2) = opa.ActivePresentation.Slides(activeslide).Shapes("star" & i).Name
        grouped(3) = opa.ActivePresentation.Slides(activeslide).Shapes("top" & i).Name
        grouped(4) = opa.ActivePresentation.Slides(activeslide).Shapes("picture" & i).Name
        ' group items
    
    ' code to group items
        
    ERR_DOESNTEXIST:
        Exit Sub
    Thank you, though not all are required. Just need to have 2 elements for grouping.

    The meaning of this grouping is that if user has to modify the presentation by hand a bit, it's easier to move the groups of objects which belong together, than all objects separately.

    So if there's no extra objects at all, I skip the grouping all together ( There is always the 'boxframe' That's where all are 'attached')

    I'm sure there's million better ways to code this than mine and I'm always writing quite bloated code. But no-one else is reading this but me

    Thanks anyway.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1