Results 1 to 9 of 9
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    naming slides (PPT97/SR2)

    I'm confused. I can't see where an end-user (using only PPT) would assign a name to a slide.
    As a developer, I've found that i can assign a name using VBA.
    This strikes me as odd. I am more familar with Word, Excel, where the end-user can assign a name to a worksheet within a book.
    Have i missed something in the menu system?

    <pre>Sub test2()
    Dim sld As Slide
    Dim strName As String
    For Each sld In ActivePresentation.Slides
    strName = "a" & strName
    sld.Name = strName ' comment this out after the first pass
    Next sld
    End Sub
    </pre>


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: naming slides (PPT97/SR2)

    The tab name the user can set in Excel is comparable to the slide title in Excel. A worksheet in Excel also has a name that is hidden from the end user: the Properties window in the Visual Basic Editor shows a (Name) property that need not be equal to the Name property. The VBA equivalent of (Name) is CodeName.

    <table border=1 cellpadding=5><tr><td>

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: naming slides (PPT97/SR2)

    Hans, thanks for the quick response, but I have to confess that I'm still confused.

    In Excel, the end-user can double-click on a worksheet tab, (or choose Format, Sheet, Rename), and change a name that happens to be visible at the foot of the end-user screen. The developer can choose View, Properties and see that the sheet now has a "(name)" that remains as "Sheet5", but has a "Name" that reads "RB Reconciliation".

    So, In Excel the end-user can assign a name to a sheet, (which name could then be used via a GUI to communicate between the user and the program code).



    In PPT, as an end-user, I can't find a way to assign a name to a slide, in the same sense that I can double-click in Excel, or follow a menu system. As a developer I can see that I have objects in the Project Explorer window "Slide1", "Slide2", "Slide3" etc, and while View, Properties doesn't show me the equivalent of "(name)", it does show me "Name", and as developer I can set "Name" to be (e.g.) "Controller". I can do that in PPT as a developer, but for the life of me I can't see how to do that as an end-user.

    The short answer might be "PPT is different from Excel", and I can live with that. I was wondering if I'd missed something, because I'd suspected that the overall structure of a PPT and an Excel object ought to be similar - they are both collections of (worksheets/slides) that contain (cells/shapes)..

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: naming slides (PPT97/SR2)

    The basic answer is "PowerPoint is different from Excel". In Excel, the worksheet name is essential for the end user because it can be used in formulas to refer to cells on other worksheets.

    The item that comes neares to the Excel worksheet name is the title of a PowerPoint slide. There is no menu item to change it, since it is not needed: the user can type the title directly. When you insert a hyperlink to another slide, you select it by slide title.

    Word is different again from both PowerPoint and Excel. The sections and pages of a Word document don't have a name, neither in the interface, nor in Visual Basic. In VBA you refer to ActiveDocument.Sections(2) etc.

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: naming slides (PPT97/SR2)

    > The basic answer is ...

    Hans, thanks for all of this. I have managed to assemble a toolkit of PPT naming functions and will post them in this thread when I have finished housecleaning.

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: naming slides & shapes (PPT97/SR2)

    Here is a Word document with crude documentation of a suite of procedures for playing around with named shapes and slides.

    The set is incomplete; I wrote enough utility code to help me develop a set of end-user macros to give the client some idea of what might be done.

    Thanks again to all who helped, past and present and, i hope, future.

  7. #7
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: naming slides (PPT97/SR2)

    Hans,

    I think I sorted out a few things but I also wanted to ask a question on this.

    By slide title, it appears you mean the title placeholder that ppt will put at the top of a slide, no matter which slide layout you pick (except the totally blank one and maybe one or two others). I do see how to link to a one slide from another by creating a hyperlink to the first one using its title. As you said, one doesn't use a menu item or the equivalent to an Excel tab to give the slide any kind of name. I'm not sure but I think people may not think of the ppt title in the same way as the Excel sheet tab; for one thing, people may sometimes delete the title placeholder (I do sometimes) or use the blank slide. I do believe thru ppt VBA you can change the value of the title placeholder. It is an object, like other objects on the slide. Usually, I'm not sure, I think, it is object1, rectangle2, or something like that.

    However, a few weeks ago, you answered a question where someone has attached a screen shot of the ppt VBE that showed Slide1, Slide2, etc as objects. I believe your answer was that those objects showed up because there existed presently on the slides (or had at one time) some ActiveX control on them. So maybe Chris's questions revolve around that and I certainly have some questions on that:
    - is there some advantage in the VBE to being able to access the Slides by Slide1, etc? I know you can loop thru the slides in the presentation so I'm not sure what the advantage would be.
    - I tried to figure out how to add an ActiveX object to a slide (running XP) and couldn't see anything in ppt. Didn't check the VBE very much. So if there was some advantage, per the first question, how would one go about adding an ActiveX object so these slide objects become visible in the VBE. In this case, what the ActiveX is and whether it's deleted after adding is irrelevant (other than size of the file if the ActiveX control adds to the file size).
    - if you do have the Slide objects per that post, what does the VBE allow you to do with it? Are there any events? Can you rename the "Slide1" object (or add a name value, similar to Excel)?

    I think that's about it for now. I'm sure I'll think of some other questions.

    Thanks.

    Fred

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: naming slides (PPT97/SR2)

    You can insert a hyperlink on a slide by selecting (surprise, surprise) Insert | Hyperlink. If you select "Location in this document", you can select a slide by title.

    >> is there some advantage in the VBE to being able to access the Slides by Slide1, etc?
    That's up to you. It might be handy to give a slide a name, and refer to it by that name, even if it has been moved to a different position.

    >> I tried to figure out how to add an ActiveX object to a slide
    Controls from the Control Toolbox (such as a command button) count as ActiveX objects; even if you don't write code for them, they will make the slide that contains them show up in the Visual Basic Editor (VBE), and they will cause the "macro warning" to be displayed when the presentation is opened. Removing the controls will not remove the slide from the project explorer in the VBE; you'd have to delete and re-create the slide for that.

    >> if you do have the Slide objects per that post, what does the VBE allow you to do with it?
    Controls from the Control Toolbox have events associated with them, such as the On Click event; the code for these events goes into the slide module.

    >> Can you rename the "Slide1" object?
    Yes, the way indicated by Chris, or in the Properties window in the VBE.

  9. #9
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: naming slides (PPT97/SR2)

    Hi Hans,

    Is there anything you don't know? You're a font of knowledge. Thanks for the answers.

    I did see how to insert a link to another slide; that was easy. The other stuff wasn't obvious to me. I think I tried the Control Toolbox a few weeks ago when you answered that other post. I must have done something wrong since I didn't get any Slide objects in the VBE. This time I did.

    One small difference between Excel and PPT in terms of what's shown as far as naming: in Excel, the initial VBE name is Sheet1 (Sheet1). When you change the sheet name via the user interface, it becomes Sheet1(user_name) in the Project Window in the VBE but the Properties drop-down does not show the user_name assigned to the Name property. PPT's VBE is a little different: the Project window does not have a parenthetical for the name but the Project window does show the value of the name property in the drop-down.

    In terms of advantages to giving a slide a name, I was thinking more in terms of the slide object itself and any events that you might be able to access (at least in XP). I see now that slides don't really have anything in the way of events. It seems like you can declare things in the slide module and maybe write some general subs. But all the action is with the activex objects (lots of events).

    Fred

Posting Permissions

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