none
Named text placeholders in powerpoint RRS feed

  • Question

  • Hi

    Is it possible to have named place holders in power point such as name, tel, mobile etc for text to be filled in programatically? If so how does it work and what code is required to fill them up? If not what are the options?

    Thanks

    Regards

    Saturday, January 3, 2015 11:11 PM

Answers

  • Hi Yahya,

    Thanks for posting in MSDN forum.

    According to the description, you want to insert a place holder into a presentation and want to fill the value programmatically. Here is an example that insert an named textbox and we can fill the data via the name:

    Sub cretaeTextBox()
    Dim txtBox As Shape
    
    Set txtBox = Application.ActivePresentation.Slides(1).Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, _
        Left:=100, Top:=100, Width:=200, Height:=50)
        
        txtBox.TextFrame.TextRange.Text = "Test Box"
    txtBox.Name = "tb1"
    End Sub
    
    Sub setValue()
    Application.ActivePresentation.Slides(1).Shapes("tb1").TextFrame.TextRange.Text = "Set a new value!"
    End Sub
    
    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 7, 2015 3:38 AM
    Moderator

All replies

  • Maybe some of the links on this page will give you some ideas on how you might apply Visio to what you're attempting to do.

    http://www.visguy.com/2012/02/01/roll-em-new-visio-2010-video-series-by-visio-mvps/

    al edlund


    Al Edlund Visio MVP

    Sunday, January 4, 2015 5:26 PM
  • Hi Yahya,

    Thanks for posting in MSDN forum.

    According to the description, you want to insert a place holder into a presentation and want to fill the value programmatically. Here is an example that insert an named textbox and we can fill the data via the name:

    Sub cretaeTextBox()
    Dim txtBox As Shape
    
    Set txtBox = Application.ActivePresentation.Slides(1).Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, _
        Left:=100, Top:=100, Width:=200, Height:=50)
        
        txtBox.TextFrame.TextRange.Text = "Test Box"
    txtBox.Name = "tb1"
    End Sub
    
    Sub setValue()
    Application.ActivePresentation.Slides(1).Shapes("tb1").TextFrame.TextRange.Text = "Set a new value!"
    End Sub
    
    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 7, 2015 3:38 AM
    Moderator