Jump to content

Please read the Forum Rules before posting.

Photo

Finding textboxes in a Word document


  • Please log in to reply
9 replies to this topic

#1 ebulerdo

ebulerdo

    e-Sword Fanatic

  • Contributors
  • PipPipPipPipPip
  • 127 posts
Offline

Posted 24 February 2012 - 06:34 AM

Hi All

I have a Word document with a bible that has been scanned and OCRed by someone. The OCR software has put some of the text in textboxes, so I need to copy their content to the main text and then remove the textboxes. Fortunately there doesn't seem to be too many of them.

However, I haven't been able to find an easy way to locate the textboxes. Do you know of any code that can be used to find them (such as ^p for paragraphs), or if not possible, some macro that would help me locate them?

Thanks!

Carlos

#2 DSaw

DSaw

    Resource Builder

  • Members (T)
  • PipPipPipPipPip
  • 1,159 posts
  • LocationEast Coast
Offline

Posted 24 February 2012 - 07:23 AM

Josh will likely have a better way but did you try revealing the formatting shift + F1 then select show all formatting marks

or if you find one try find similar formatting on the right click menu at bottom there should be select text with similar formatting

May God change our hearts to what the truth is

2Ti_2:15 Study to shew thyself approved unto God, a workman that needeth not to be ashamed, rightly dividing the word of truth.

Rom_9:16 So then it is not of him that willeth, nor of him that runneth, but of God that sheweth mercy.

2Ti 2:24-25  And the servant of the Lord must not strive; but be gentle unto all men, apt to teach, patient, In meekness instructing those that oppose themselves; if God peradventure will give them repentance to the acknowledging of the truth; 
 

 

 


#3 Josh Bond

Josh Bond

    Administrator

  • Administrators
  • PipPipPipPipPip
  • 2,890 posts
  • LocationGallatin, TN
Offline

Posted 24 February 2012 - 09:54 AM

Hi All

I have a Word document with a bible that has been scanned and OCRed by someone. The OCR software has put some of the text in textboxes, so I need to copy their content to the main text and then remove the textboxes. Fortunately there doesn't seem to be too many of them.

However, I haven't been able to find an easy way to locate the textboxes. Do you know of any code that can be used to find them (such as ^p for paragraphs), or if not possible, some macro that would help me locate them?

Thanks!

Carlos

Carlos,

1) Select the whole document in Word and copy.
2) Paste into Wordpad.
3) Select the whole document in Wordpad and copy.
4) Paste back into Word.

The textboxes are gone.

#4 BaptizedBeliever

BaptizedBeliever

    Christian

  • Members (T)
  • PipPipPipPipPip
  • 924 posts
Offline

Posted 24 February 2012 - 11:25 AM

Or you could create and run this macro. If the document has tables in it, though, that you are wanting to keep, don't use this.

Sub AllTablestoText()
'
' AllTablestoText Macro
'
For Each aTable In ActiveDocument.Tables

aTable.ConvertToText wdSeparateByParagraphs, True

Next aTable

End Sub


#5 Josh Bond

Josh Bond

    Administrator

  • Administrators
  • PipPipPipPipPip
  • 2,890 posts
  • LocationGallatin, TN
Offline

Posted 24 February 2012 - 11:31 AM

Or you could create and run this macro. If the document has tables in it, though, that you are wanting to keep, don't use this.

Sub AllTablestoText()
'
' AllTablestoText Macro
'
For Each aTable In ActiveDocument.Tables

aTable.ConvertToText wdSeparateByParagraphs, True

Next aTable

End Sub


That convert's tables to text, but not text boxes to text. :) If you need to remove all tables, though, that's the macro to use.

#6 BaptizedBeliever

BaptizedBeliever

    Christian

  • Members (T)
  • PipPipPipPipPip
  • 924 posts
Offline

Posted 24 February 2012 - 12:24 PM

Um...

If I'm not mistaken, a text box is considered a 1x1 table by Word, though I could be wrong. I've used this one to deal with text boxes before, and it seemed to work just fine.

At least I thought it did.

But I'm sick right now, and I've slept since then, too.

Brad

#7 Josh Bond

Josh Bond

    Administrator

  • Administrators
  • PipPipPipPipPip
  • 2,890 posts
  • LocationGallatin, TN
Offline

Posted 24 February 2012 - 12:32 PM

Um...

If I'm not mistaken, a text box is considered a 1x1 table by Word, though I could be wrong. I've used this one to deal with text boxes before, and it seemed to work just fine.

At least I thought it did.

But I'm sick right now, and I've slept since then, too.

Brad


Hey,

Naw, Word considers text boxes, frames, and tables three different objects (although frames are apart of the paragraph). If you click Insert in Word 2010, insert a couple of Text Boxes with text, and then run the macro, it does nothing. If you insert a couple of Tables with text, and run the macro, it removes the table object(s) while retaining the text.

Hope ya get to feeling better,

josh

#8 ebulerdo

ebulerdo

    e-Sword Fanatic

  • Contributors
  • PipPipPipPipPip
  • 127 posts
Offline

Posted 24 February 2012 - 05:13 PM

Hi DSaw, Josh and Brad

Thank you for your answers. But...

Josh will likely have a better way but did you try revealing the formatting shift + F1 then select show all formatting marks
or if you find one try find similar formatting on the right click menu at bottom there should be select text with similar formatting


I tried those, but it only takes the format of the text inside the textbox, not the object itself.

1) Select the whole document in Word and copy.
2) Paste into Wordpad.
3) Select the whole document in Wordpad and copy.
4) Paste back into Word.

The textboxes are gone.


That's what I do when I want to get rid of textboxes. But in this case I need to copy their content first to the document. :-/


Or you could create and run this macro. If the document has tables in it, though, that you are wanting to keep, don't use this.


I will try that macro, but it seems it's for tables, not textboxes. I will tell you how it went.

Thank you!

Carlos

#9 Josh Bond

Josh Bond

    Administrator

  • Administrators
  • PipPipPipPipPip
  • 2,890 posts
  • LocationGallatin, TN
Offline

Posted 24 February 2012 - 05:35 PM

That's what I do when I want to get rid of textboxes. But in this case I need to copy their content first to the document. :-/


This works for me, when copying from Word to Wordpad and back. It retains the text from the table, but not the table itself. I'm using Word 2010.

#10 ebulerdo

ebulerdo

    e-Sword Fanatic

  • Contributors
  • PipPipPipPipPip
  • 127 posts
Offline

Posted 24 February 2012 - 05:45 PM

This works for me, when copying from Word to Wordpad and back. It retains the text from the table, but not the table itself. I'm using Word 2010.


You are right, it works. Thank you!

Carlos




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users




Similar Topics



Latest Blogs