Consulting

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
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,191
    Location
    Could it be that:
    objTextBoxA.TextFrame.Value
    Should it not be be .Text instead of .Value
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved

    Excel 365, Version 2403, Build 17425.20146

  3. #3
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    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
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

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
  •