Results 1 to 3 of 3

Thread: Copying Text from One Shape on one slide and Pasting it into another shape on another

  1. #1

    Copying Text from One Shape on one slide and Pasting it into another shape on another

    Hello! I'm really hoping you all can help me out. I'm at a complete loss, and all of the current content I looked at didn't help much. I (obviously) am very new to this, and have hit a bit of a snag.

    In the code below, I am trying to take the text from "dsscust1stname" on the "Infokey" slide and paste the text into the "TextBox3" on the "Coverletter" slide however it breaks right at the end of the code, giving a compile error: method or data member not found. Help???

    Sub ReplaceALL()
    Dim objPresentation As Presentation
    Dim objSlide1 As Slide
    Dim objTextBox1 As Shape
    Dim objSlideA As Slide
    Dim objTextBoxA As Shape
    Set objPresentation = ActivePresentation
    Set objSlide1 = objPresentation.Slides("Coverletter")
    Set objTextBox1 = objSlide1.Shapes.Item("TextBox3")
    Set objSlideA = objPresentation.Slides("Infokey")
    Set objTextBoxA = objSlideA.Shapes.Item("dsscust1stname")
    objTextBox1.TextFrame.TextRange.Text = objTextBoxA.TextFrame.Value
    End Sub
    Last edited by Aussiebear; 12-28-2022 at 06:52 PM. Reason: Added code tags to supplied code

  2. #2
    VBAX Expert
    Mar 2008
    Kent, England
    Could it be that:
    Should it not be be .Text instead of .Value
    If things don't change they stay the same
    Quite often there is a picnic problem (problem in chair not in computer)
    "We were not told it was impossible, so we did it."

  3. #3
    VBAX Master
    Feb 2007
    It can't be .text or .value. Milkeg you need to make it clear whether the text boxes are standard textboxes or ActivX boxes (That can be changed in show mode)##If they are standard textboxes it might be

    Set objTextBox1.TextFrame.TextRange= objTextBoxA.TextFrame.TextRange
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials

Tags for this Thread

Posting Permissions

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