Macro to Copying Contents of Text Boxes

J

jerem

Anyone out there have a macro that can find textboxes in a document (one at a
time) and copy the text in them, maybe load them into the clipboard (or maybe
store them in a place that has a larger capacity than the clipboard???), then
unload all of them into a new document? Thanks in advance.
 
H

Helmut Weber

Hi jerem,
Anyone out there have a macro that can find textboxes in a document (one at a
time) and copy the text in them, maybe load them into the clipboard (or maybe
store them in a place that has a larger capacity than the clipboard???), then
unload all of them into a new document? Thanks in advance.

something along these lines:

Sub Test6()
Dim Doc1 As Document
Dim Doc2 As Document
Dim oShp As shape
Set Doc1 = ActiveDocument
Set Doc2 = Documents.Add
For Each oShp In Doc1.shapes
If oShp.TextFrame.HasText Then
Doc2.Range.InsertAfter oShp.TextFrame.TextRange
End If
Next
End Sub
--

Greetings from Bavaria, Germany

Helmut Weber

Vista Small Business, Office XP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top