Removing text box from word document without removing the text inside the box

I have to edit a 147 page document that was originally in PDF form.  I used a PDF converter to change it to a Word document for the ease of editing.  Now the Word document has text boxes around sentences and paragraphs.  I need to remove those text boxes but keep the text that is inside those boxes.

Did I over complicate things by converting it?  Is there a better way to edit the document?

Answer
Answer

If the "PDF converter" that you used was a third-party program, it was probably responsible for inserting the text boxes. Instead, try just opening the original PDF file in Word. That may give you the "unboxed" document you want.

If that doesn't help, then use the macro at the end of https://www.datanumen.com/blogs/2-quick-methods-extract-texts-text-boxes-word-document/. (The first method in that article will be too tedious for use in a long document with many boxes.) To install the macro, see http://www.gmayor.com/installing_macro.htm. Run the macro on a copy of the document, not the one you got from the PDF, because after the macro runs you'll have to copy/paste the texts from the boxes back into the document where the boxes have been deleted -- you'll need the original to know where the boxes used to be.

_____________________________
https://jay-freedman.info

2 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Answer
Answer

A Word macro one could use for the clean-up is:

Sub EraseTextBoxes()
Dim RngDoc As Range, RngShp As Range, i As Long
With ActiveDocument
  For i = .Shapes.Count To 1 Step -1
    With .Shapes(i)
      If .Type = msoTextBox Then
        Set RngShp = .TextFrame.TextRange
        RngShp.End = RngShp.End - 1
        Set RngDoc = .Anchor
        RngDoc.Collapse wdCollapseEnd
        RngDoc.FormattedText = RngShp.FormattedText
        .Delete
      End If
    End With
  Next
End With
End Sub

Unlike the macro in Jay's link, the one above preserves the text formatting of the extracted content.

Note: Whether the macro positions the output correctly depends on where the textboxes are anchored; if the anchor positions are unrelated to the textbox locations, one will end up with a dog's breakfast. Even when that’s not the case, the document may still end up with each line as its own paragraph. To clean up such content, see:
http://www.msofficeforums.com/word/29880-cleaning-up-text-pasted-websites-e-mails.html

For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
For Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html

Cheers
Paul Edstein
(Fmr MS MVP - Word)

4 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated April 20, 2021 Views 1,195 Applies to: