Results 1 to 5 of 5

Thread: How to modify the text inside a text box with VBA?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,096
    Location
    Few things then:
    Because you have Dim ResultA inside the sub it will be reset to zero each time it runs

    Place it OUTSIDE of the sub but in the same module then it will keep score

    Dim ResultA
    Sub AddtoPersonA
    etc
    If you name the textbox yourself rather than the default name it won't change when pasted
    In 2007 you can do this in the selection pane in earlier versions you must use vba :

    Sub Namer()
    'select the first box and run this
    On Error Resume Next
    ActiveWindow.Selection.ShapeRange(1).Name = "MyBox"
    End Sub
    To add text on the current slide in the show

    With ActivePresentation.SlideShowWindow.View.Slide _
        .Shapes("MyBox").TextFrame.TextRange
        .Text = ResultA
        .Font.Size = 32
    End With
    Hope that helps

    John
    Last edited by Aussiebear; 04-28-2023 at 08:57 PM. Reason: Adjusted the code tags
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

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