Explode text box?

  • Thread starter Thread starter tcebob
  • Start date Start date
T

tcebob

A certain PDF converter program places text in text boxes when it converts to Word. How
can I get the text out of the box? I think the boxes are linked, because if I delete one
the whole page disappears. However, I know next to nothing about text boxes.

Also, how can I get the boxes to be invisible? Not the text, of course, but the dashed
outline around the box.

rs
 
Try running this procedure posted earlier by Helmut Weber:

Sub ConvertTextBoxesToText()
Dim oShp As Shape ' a shape
Dim lPrg As Long ' the position of the anchor
Dim rTmp As Range ' a temporary range
Dim nPrg As Long ' number of paragraph anchor is in
Dim lShp As Long ' counter for shapes
With ActiveDocument.Shapes
For lShp = .Count To 1 Step -1
If .Item(lShp).Type = msoTextBox Then
sTxt = .Item(lShp).TextFrame.TextRange.Text
lPrg = .Item(lShp).Anchor.Start
Set rTmp = ActiveDocument.Range(Start:=0, End:=lPrg)
nPrg = rTmp.Paragraphs.Count + 1
ActiveDocument.Paragraphs(nPrg).Range.Text = _
ActiveDocument.Paragraphs(nPrg).Range.Text & " " & sTxt
End If
Next
End With
End Sub
 
Wow! 14 minutes. Thanks, Greg, for being alert.

rs

: Try running this procedure posted earlier by Helmut Weber:
:
: Sub ConvertTextBoxesToText()
: Dim oShp As Shape ' a shape
: Dim lPrg As Long ' the position of the anchor
: Dim rTmp As Range ' a temporary range
: Dim nPrg As Long ' number of paragraph anchor is in
: Dim lShp As Long ' counter for shapes
: With ActiveDocument.Shapes
: For lShp = .Count To 1 Step -1
: If .Item(lShp).Type = msoTextBox Then
: sTxt = .Item(lShp).TextFrame.TextRange.Text
: lPrg = .Item(lShp).Anchor.Start
: Set rTmp = ActiveDocument.Range(Start:=0, End:=lPrg)
: nPrg = rTmp.Paragraphs.Count + 1
: ActiveDocument.Paragraphs(nPrg).Range.Text = _
: ActiveDocument.Paragraphs(nPrg).Range.Text & " " & sTxt
: End If
: Next
: End With
: End Sub
:
:
:
: --
: Greg Maxey/Word MVP
: See:
: http://gregmaxey.mvps.org/word_tips.htm
: For some helpful tips using Word.
:
: tcebob wrote:
: > A certain PDF converter program places text in text boxes when it
: > converts to Word. How can I get the text out of the box? I think the
: > boxes are linked, because if I delete one the whole page disappears.
: > However, I know next to nothing about text boxes.
: >
: > Also, how can I get the boxes to be invisible? Not the text, of
: > course, but the dashed outline around the box.
: >
: > rs
:
:
 
Are they definitely Text Boxes rather than Frames? If it is frames, you can
simply do a SelectAll (Ctrl+A) and RemoveFrames (though you will need to
drag this command onto a Toolbar using Customise dialog).

--
Terry Farrell - Word MVP
http://word.mvps.org/

: Wow! 14 minutes. Thanks, Greg, for being alert.
:
: rs
:
: :: Try running this procedure posted earlier by Helmut Weber:
::
:: Sub ConvertTextBoxesToText()
:: Dim oShp As Shape ' a shape
:: Dim lPrg As Long ' the position of the anchor
:: Dim rTmp As Range ' a temporary range
:: Dim nPrg As Long ' number of paragraph anchor is in
:: Dim lShp As Long ' counter for shapes
:: With ActiveDocument.Shapes
:: For lShp = .Count To 1 Step -1
:: If .Item(lShp).Type = msoTextBox Then
:: sTxt = .Item(lShp).TextFrame.TextRange.Text
:: lPrg = .Item(lShp).Anchor.Start
:: Set rTmp = ActiveDocument.Range(Start:=0, End:=lPrg)
:: nPrg = rTmp.Paragraphs.Count + 1
:: ActiveDocument.Paragraphs(nPrg).Range.Text = _
:: ActiveDocument.Paragraphs(nPrg).Range.Text & " " & sTxt
:: End If
:: Next
:: End With
:: End Sub
::
::
::
:: --
:: Greg Maxey/Word MVP
:: See:
:: http://gregmaxey.mvps.org/word_tips.htm
:: For some helpful tips using Word.
::
:: tcebob wrote:
:: > A certain PDF converter program places text in text boxes when it
:: > converts to Word. How can I get the text out of the box? I think the
:: > boxes are linked, because if I delete one the whole page disappears.
:: > However, I know next to nothing about text boxes.
:: >
:: > Also, how can I get the boxes to be invisible? Not the text, of
:: > course, but the dashed outline around the box.
:: >
:: > rs
::
::
:
:
 
tcebob shared this with us in microsoft.public.word.newusers:
Wow! 14 minutes. Thanks, Greg, for being alert.

Be alert.
This world needs more lerts.
;-)
 
Back
Top