N
Nomey
In a document, various text boxes with formatted text, even with tables
in them, exist.
I would like to cut all textbox content in all text boxes and copy it to
a second document for editing, and once edited, move the content back to
the original textboxes.
I have this macro (see below), but it copies (it should cut) and it
deletes all formatting and tables. Is there a better way to cut? How do
I get the content back to the original textboxes?
Shirley Nomey.
Sub CopyFromTextBoxes()
Dim I As Integer, Boite As Shape, ThisDoc As Document
Set ThisDoc = ActiveDocument
Documents.Add
For Each Boite In ThisDoc.Shapes
If Boite.Type = msoGroup Then
For I = 1 To Boite.GroupItems.Count
With Boite.GroupItems(I).TextFrame
If .HasText Then
Selection.InsertAfter .TextRange
Selection.InsertParagraphAfter
Selection.Start = Selection.End
End If
End With
Next
Else
With Boite.TextFrame
If .HasText Then
Selection.InsertAfter .TextRange
Selection.InsertParagraphAfter
Selection.Start = Selection.End
End If
End With
End If
Next
End Sub
in them, exist.
I would like to cut all textbox content in all text boxes and copy it to
a second document for editing, and once edited, move the content back to
the original textboxes.
I have this macro (see below), but it copies (it should cut) and it
deletes all formatting and tables. Is there a better way to cut? How do
I get the content back to the original textboxes?
Shirley Nomey.
Sub CopyFromTextBoxes()
Dim I As Integer, Boite As Shape, ThisDoc As Document
Set ThisDoc = ActiveDocument
Documents.Add
For Each Boite In ThisDoc.Shapes
If Boite.Type = msoGroup Then
For I = 1 To Boite.GroupItems.Count
With Boite.GroupItems(I).TextFrame
If .HasText Then
Selection.InsertAfter .TextRange
Selection.InsertParagraphAfter
Selection.Start = Selection.End
End If
End With
Next
Else
With Boite.TextFrame
If .HasText Then
Selection.InsertAfter .TextRange
Selection.InsertParagraphAfter
Selection.Start = Selection.End
End If
End With
End If
Next
End Sub