• PPT2K displaying doc_properties on master slides

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » PPT2K displaying doc_properties on master slides

    Author
    Topic
    #355452

    I need to display some document properties (Menu File>Properties) like title, company, author etc on the slide master. I know how to get them into VBA, but I don’t know how to display them on a master like a buildin variable (date, pagenum).

    Any help would be highly appreciated.

    Viewing 0 reply threads
    Author
    Replies
    • #528339

      ——– Original Post ————————
      I need to display some document properties on the slide master.
      Peter

      ——– Reply —————————————–

      Peter, I wasn’t sure if you wanted the info placed in the footer or in a new textbox on the master, so I did both, plus used a custom doc property. Hope this helps! See code below. –Sam

      Sam Barrett, MTL Systems, Inc., mailto:sam@mtl.com
      Brainbench MVP, http://www.brainbench.com

      And the things that you have heard…commit these to faithful
      men who will be able to teach others also. 2 Timothy 2:2

      Sub makeMaster()
      Dim shpMaster As Shape
          With ActivePresentation.SlideMaster.HeadersFooters.Footer
              .Text = ActivePresentation.BuiltInDocumentProperties("Author")
              .Visible = msoTrue
          End With
          Set shpMaster = ActivePresentation.SlideMaster.Shapes.AddTextbox _
                  (Orientation:=msoTextOrientationHorizontal, Left:=30, Top:=497, Width:=125, Height:=40)
          shpMaster.Name = "shpDocProp"   ' So you can find it later
          With shpMaster.TextFrame
              .TextRange.Paragraphs().ParagraphFormat.Bullet.Visible = msoFalse
              .TextRange.Text = ActivePresentation.CustomDocumentProperties("Disposition")
              .TextRange.Font.Size = 14
          End With
      End Sub
      
      • #528452

        Sam, thanx a lot. This detailed answer to my unspecific question (putting the blame on me 😉 is very helpfull because indeed I need text boxes and footers on all kind of master master pages. Inspired by your examples it should be possible for me to figure out how to update a field on a title- or notes-master.

        May be it’s a stupid question: where do I call the Code ???

        Is it OK to place a text box on the master and call the subroutine from their data property (how ?). Or do I have to place a “Update fields” button to the master to get the subroutines run on demand.

        I would prefer a solution, where the fields would be updated automatically when a presentation is opened and/or saved.

        I’m a VBA newbie. Sorry for asking simple questions.

        • #528637

          Peter, your question is not stupid. There are no stupid questions in Power Point. Its Object Model is horrific and handling events is worse. There is not a readily available Auto_Open or Auto_Close like Excel and Word: you have to write an AddIn, which I have not done, but here are some web resources for everything you never wanted to know about Power Point and programming (o: Have Fun ) –Sam

          Steve Rindsberg Tips http://www.rdpslides.com/pptfaq/
          Shyam Pillai Tips http://www.mvps.org/skp/vba.htm#ppt
          David Foster Tips http://www.panix.com/~dfoster/prog/office/pptvba/index.html
          Power Point MVP

          • #528657

            Sam,
            I’m overwhelmed . You’re absolutely right, the PPT object model is a mess. I’m used to Word and Excel, where many things related to VBA are much simpler to figure out.

            I gratefully appreciate your support

            Thanx alot.

      • #529605

        Your sample code works almost for PPT97. I was directed to this forum to find the answer to my question.

        I am trying to do something similar with the document properties, however, I wish to place the contents of the properties from each tab on a PowerPoint slide so I can better keep track of the multitude of revisions and statistics that swamp me weekly. I am a VB dummy and am willing to learn.

        I have found several examples of other code that show me how to add a slide, and add both path and filename or author… I am in need of something greater.

        Can you recommend a good resource to learn PowerPoint VB, like a book or video?.

        I am using both PP97 (home) and PP2K SR1 (work).
        I will appreciate any guidance in this endeavor.

        Thanks in advance,
        Ryan W.

        • #529628

          Ryan, The good news is that the code you need is back in your original thread, but I’ve not yet tried in in PP97. The bad news is that there is no good reference for the Power Point Object model. The PP2K help files are the best you can do, but the PP97 help files are worthless. Steven Roman’s book Writing Word Macros will help, because his overview of VBA is the same for PP and the material on shapes is also applicable to PowerPoint. Hope this helps! –Sam

    Viewing 0 reply threads
    Reply To: PPT2K displaying doc_properties on master slides

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: