Consulting

Results 1 to 7 of 7

Thread: Object names

  1. #1

    Object names

    In PowerPoint 2000, what I want to do is a snap. I just use the properties window and name various objects anything I want to. But in 2003 and 2007, I am having a heck of a time.

    I have a need to place various objects (clipart, circles, squares, freedrawn objects, etc) on a slide and then control their actions using VBA from various hotspots (command buttons, labels, etc) spread around the slide.

    Using the normal actions won't work. I need to use VBA and control everything including fading objects in and out and moving them around the slide.

    Need help
    ttfn

    Kicker

  2. #2
    VBAX Mentor Brandtrock's Avatar
    Joined
    Jun 2004
    Location
    Titonka, IA
    Posts
    399
    Location
    If I understand you correctly, in 2000 you can get things to work the way you want, but not in 2003 and 2007.

    Do you have any code you can post?

    What isn't being done (specifically) that you want done?

    Regards,
    Brandtrock




  3. #3
    Unfortunately, I cannot send you a copy of the slide as it is very sensitive and I would get into a whole lot of trouble. However, there is the code for one out of over 25 command buttons.

    [VBA]Private Sub CommandButton10_Click()
    If ActivePresentation.Slides(1).Shapes(11).Visible = msoTrue Then
    ActivePresentation.Slides(1).Shapes(11).Visible = msoFalse
    Else
    ActivePresentation.Slides(1).Shapes(11).Visible = msoTrue
    End If
    End Sub[/VBA]

    Rather than call it commandbutton10, I would like to call it cmdPop5 and have the shape named area5.

    I have a project coming up that will have more than 100 slides and probably over 10+ shapes controlled by VBA. Being able to call them by name would make it a lot easier.
    ttfn

    Kicker

  4. #4
    VBAX Mentor Brandtrock's Avatar
    Joined
    Jun 2004
    Location
    Titonka, IA
    Posts
    399
    Location
    I don't have 2007 yet, but in my PowerPoint 2003, the VBE doesn't display the Properties window when it first launches. Once I display it, I can do manipulations on all of the visible properties of control toolbox controls and Forms controls but not shapes. The command button issue you describe should be able to be addressed through the properties window. Or were you trying to rename these via code?

    I'm still mulling over the shapes issue, although it appears to be the same in 2000 and 2003. How were you naming shapes in 2000?

    I haven't played around with the differences in the actions for the shape objects between the two versions. I generally learn something (or several things) about PowerPoint every time I open it.

    Regards,
    Brandtrock




  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    What exactly are you having problems with? Are you not able to rename the button, or not able to control the shapes with it. AS Brandtrock says, you should be able to rename the button in the VBE, just double-click it in design.

  6. #6
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    As the others said you can rename control object in the property window.

    You can name shapes with vba see below but also shapes have a default name eg "rectangle 1" which you can use as .shapes("rectangle 1"). If you install the select multiple objects tool (see "add a command to a toolbar" on Powerpoint alchemy) you can read this name from the menu.

    [vba]Sub namer()
    Dim strname As String
    On Error GoTo errhandler
    If ActiveWindow.Selection.ShapeRange.Count <> 1 Then Exit Sub
    strname = InputBox("Name the shape")
    ActiveWindow.Selection.ShapeRange.Name = strname
    Exit Sub
    errhandler:
    MsgBox "There's an error - probably you didn't select a shape?"
    End Sub[/vba]
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  7. #7
    I think I have had a little brain malfunction. Didn't get notifications that there were some answers to the thread. Sorry.

    Another malfunction is that I was previously naming objects in Excel, not PowerPoint. However, with that "figured out" I just started making a cross reference list for my object names.

    This weekend I am going to post another question with an example of a slide I need help with making the Timer() function work with the named objects.
    ttfn

    Kicker

Posting Permissions

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