none
Inserting text into existing text in Powerpoint RRS feed

  • Question

  • Hi

    I have a text like "I have included xxx in the quote." in a slide. How can I insert text such as '8 items per head' in place of xxx via code?

    Thanks

    Regards

    Wednesday, April 1, 2015 10:30 PM

Answers

  • Hi,

    >> How can I insert text such as '8 items per head' in place of xxx via code .

    You can use Replace () method to replace "xxx" .Here is the sample code for you , which you can refer to replace "XXX" in the textRange in your PowerPoint  

    Set myDocument = ActivePresentation.Slides(2)

    Dim str

    For Each s In myDocument.Shapes

    If s.HasTextFrame And s.TextFrame.HasText Then

      str = s.TextFrame.TextRange.Text

      s.TextFrame.TextRange.Text = Replace(str, "xxx", "8 items per head")

       End If

    Next

    Best Regards

    Lan


    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.

    Friday, April 3, 2015 5:07 AM
    Moderator