Howard,
Thanks, very useful and necessary feedback for anyone that wants
to use the macro.
I did a quick test after finding the
macro on the net, and used a temporary document that had
two text boxes (that were not inline) with a few text paragraphs
around the boxes. I have my clients "trained" not to use text boxes
(or other "float on text" objects) and rarely have to remove text
boxes, etc. from draft documents received for formatting.
Neil.
On 2/09/2011 12:11 PM, Howard Silcock wrote:
Neil
I have some concerns about the macro you posted. If it works
for Warren, well, that fixes the immediate need. But it didn't
work on the test document I created. A problem arises if a
text box is set inline, rather than floating. My test document
had some text boxes of each type and the floating ones worked,
but the others caused errors. (Actually, I mean the floating
ones worked once the others had been removed - the presence of
an inline one caused the whole macro to fail.)
Also the macro loops through every shape in the document,
regardless of whether they are textboxes or not, and attempts
to carry out its steps. I guess in most cases if you had, say,
graphics (which are also shapes), the macro would just fail
when it attempted to process them too - I haven't yet tested
that.
Another point that I wasn't clear about is where the macro is
supposed to put the text it retrieves from the text boxes. The
only place that made much sense was to add it to the end of
the document. This macro is designed to do that and seems to
work, but may need more testing (use at your own risk):
Sub GetTextFromTextboxes()
Dim tb As Shape
Dim s As String
Dim i As Integer
s = ""
With ActiveDocument
For i = .Shapes.Count To 1 Step -1
If .Shapes(i).Type = msoTextBox
Then
s = s &
.Shapes(i).TextFrame.TextRange.Text
.Shapes(i).Delete
End If
Next
.Range.InsertAfter Text:=s
End With
End Sub
Howard
**************************************************
To view the austechwriter archives, go to www.freelists.org/archives/austechwriter
To unsubscribe, send a message to austechwriter-request@xxxxxxxxxxxxx with "unsubscribe" in the Subject field (without quotes).
To manage your subscription (e.g., set and unset DIGEST and VACATION modes) go to www.freelists.org/list/austechwriter
To contact the list administrator, send a message to austechwriter-admins@xxxxxxxxxxxxx
**************************************************
|