Explode text box?



tcebob
07-09-2005, 11:01 PM
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

Greg Maxey
07-09-2005, 11:01 PM
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
07-09-2005, 11:01 PM
Wow! 14 minutes. Thanks, Greg, for being alert.

rs

"Greg Maxey" <gmaxey@mvps.OscarRomeoGolf> wrote in message
news:OvQx55jXFHA.3840@tk2msftngp13.phx.gbl...
: 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
:
:

TF
07-09-2005, 11:01 PM
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/

"tcebob" <handle @ gwi.net> wrote in message
news:eNniYDkXFHA.3620@TK2MSFTNGP09.phx.gbl...
: Wow! 14 minutes. Thanks, Greg, for being alert.
:
: rs
:
: "Greg Maxey" <gmaxey@mvps.OscarRomeoGolf> wrote in message
: news:OvQx55jXFHA.3840@tk2msftngp13.phx.gbl...
:: 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
::
::
:
:

Amedee Van Gasse
07-09-2005, 11:02 PM
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.
;-)

--
Amedee Van Gasse using XanaNews 1.17.4.1


Explode text box?