J
jerem
I've literally spent hours (googling every which way of posing this question
-- select text in textbox, highlight text from textbox, copy text from
textbox, set focus to textbox, etc.) trying to figure out how to do this with
no success:
Have a macro scan through an entire document looking for text boxes -- at
every occurrence of finding a textbox, copy the text in the textbook, delete
the text box and paste the text just copied from the textbox right back into
the position that the textbox resided. (And yes, I've looked in the website
for copying from the clipboard), So, with the code below I've been able to
find the textboxes and delete them, but I cannot for the life of me figure
how to actually get into those text boxes to copy the text. H E L P! I
think I'm going to have to drink a whole bottle of wine now to console myself
and if you're in a delightful mood, documentation would be lovely, but not
absolutely necessary. As always, thanks in advance for your help.
Sub Macro1()
'
' Macro1 Macro
Dim i As Long
For i = ActiveDocument.Shapes.Count To 1 Step -1
Selection.GoTo What:=wdGoToGraphic, Which:=wdGoToFirst, Count:=i, Name:=""
'ActiveDocument.Shapes("Text Box", i).Select
'Selection.WholeStory
'Selection.Copy
Selection.Delete
Next i
End Sub
-- select text in textbox, highlight text from textbox, copy text from
textbox, set focus to textbox, etc.) trying to figure out how to do this with
no success:
Have a macro scan through an entire document looking for text boxes -- at
every occurrence of finding a textbox, copy the text in the textbook, delete
the text box and paste the text just copied from the textbox right back into
the position that the textbox resided. (And yes, I've looked in the website
for copying from the clipboard), So, with the code below I've been able to
find the textboxes and delete them, but I cannot for the life of me figure
how to actually get into those text boxes to copy the text. H E L P! I
think I'm going to have to drink a whole bottle of wine now to console myself
and if you're in a delightful mood, documentation would be lovely, but not
absolutely necessary. As always, thanks in advance for your help.
Sub Macro1()
'
' Macro1 Macro
Dim i As Long
For i = ActiveDocument.Shapes.Count To 1 Step -1
Selection.GoTo What:=wdGoToGraphic, Which:=wdGoToFirst, Count:=i, Name:=""
'ActiveDocument.Shapes("Text Box", i).Select
'Selection.WholeStory
'Selection.Copy
Selection.Delete
Next i
End Sub