View Single Post
 
Old 11-14-2021, 08:27 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Red face Andrew, you mignificant mind you....

Quote:
Originally Posted by Guessed View Post
You didn't indicate where you wanted the text to go so I'll show you how to put it in front of the anchor for the textbox.
Code:
Sub GetText()
  Dim aShp As Shape, aRng As Range
  If Selection.ShapeRange.Count > 0 Then
    Set aShp = Selection.ShapeRange(1)
    Debug.Print aShp.TextFrame.TextRange.Text
    Set aRng = aShp.Anchor
    aRng.Collapse Direction:=wdCollapseStart
    aRng.FormattedText = aShp.TextFrame.TextRange.FormattedText
  End If
End Sub
YES, I don't know how you do it, I'm always amaze by you's Pros.
Sorry, I didn't say where to put it.
Where you did, is perfect. Cause at times, I've already fixed lot's of stuff already in a document that had text boxes. So when I encounter another situation in the same document, I didn't want the new textbox to affect all the others that I've fixed.

Would it be complicated to add, that text box that has been extracted, to be deleted?

I could always do it manually, but I was wondering if it's a challenge?

Regardless, thank you soooooooooo much.

Cendrinne
Reply With Quote