[RESOLVED]Extracting all text-box text from Doc
Hi,
Back again with another word-macro query. This time I'd like to be able to copy all the text out of the textboxes in a document and write them to another file, preferably with the page number of the text box appended.
There doesn't seem to be any textbox property of Document, so I'm not sure what angle to approach this from.
Cheers,
P
Re: Extracting all text-box text from Doc
Got the first bit done - I needed to use Shapes
VB Code:
Sub ExtractTextBoxes()
Dim s As Shape
Dim mString As String
For Each s In ActiveDocument.Shapes
If s.TextFrame.HasText = True Then
mString = s.TextFrame.TextRange.Text
End If
Next s
End Sub
1 Attachment(s)
Re: [RESOLVED]Extracting all text-box text from Doc
Just thought I'd update this with the working code to extract and replace textbox text, in case it's of use to anyone.