Results 1 to 8 of 8

Thread: Want to convert text in Text boxes to normal (without text boxes)

  1. #1

    Thread Starter
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Want to convert text in Text boxes to normal (without text boxes)

    Hi all,

    Our Client is sending files in RTF Document format which has some content. Each and every word in that document is in its own text boxes (i.e., the RTF has full of text; each and every word is in own text box). I need to convert it to normal word document without text boxes. But my problem is the entire content of that file is coming in text boxes. so it is very difficult to convert it to normal word document (without text boxes).

    Currently I have two choices to do that: one is select the text box and copy the content and paste it in a new file. but all formatting is lost. i have to do all formatting manually. The second option is convert it to PDF and do a conversion and check alignments give some missing formatting etc.

    These cases are ok if I got a file with full of text paragraphs. but most of the time I am getting tables. That time these ways are not smart way to do that.

    Is there any other way to convert that file to normal word document. Pls let me know.

    Currently I used to convert that document to Adobe PDF and will do a PDF conversion and then I will do a formatting as per the RTF document.

    So, it is taking to much of time consuming and effort.

    Is there any solution for this?

    Thanks!

    CS.
    Last edited by cssriraman; Jun 25th, 2005 at 07:29 AM.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Want to convert text in Text boxes to normal (without text boxes)

    do you want to post or send a sample document??

    pete

  3. #3

    Thread Starter
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Want to convert text in Text boxes to normal (without text boxes)

    I will post a sample document at the earliest. Thanks! CS.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Want to convert text in Text boxes to normal (without text boxes)

    i put 4 textboxes with formatted text on one page and transfered the text onto the page, deleting the textboxes
    try the code below to see if it does what you want
    VB Code:
    1. Dim  s As Shape
    2.  
    3. For Each s In ActiveDocument.Shapes
    4.    
    5.     s.TextFrame.TextRange.FormattedText.Select
    6.     Selection.Copy
    7.     s.Delete
    8. Selection.WholeStory
    9. Selection.Collapse wdCollapseEnd
    10. Selection.TypeParagraph
    11. Selection.TypeParagraph
    12. Selection.Paste
    13. Next

    the code here is probably not complete, as it makes no allowance for what order the textboxes are in on the pages, or their position, if you want the replacement text to be in the same position as the textbox.
    it just takes the textboxes in order (probably order created) and places at end of document

    feel free to change the code as much as you like

    pete
    Last edited by westconn1; Jun 25th, 2005 at 11:34 PM.

  5. #5

    Thread Starter
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Sample file uploded...

    Guys,

    I am just uploading a sample file for your reference. Pls look at the same and inform me your comments.

    Pls let me know is there any options to convert that file (with text boxes) to normal word file (without text boxes).

    Thanks,

    CS.
    Last edited by cssriraman; Jun 4th, 2006 at 09:40 AM.

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Want to convert text in Text boxes to normal (without text boxes)

    point 1 the boxes in this document are frames as different to textboxes
    point 2 the frames are in order starting from some on the right hand side, centre lefthandside, then back to the right, and that is just in the heading area

    i believe it would be possible to do what you want, though at this stage i am not sure how, but the time to do it would be considerable, as the locaton of each frame would have to be stored with its text content to rebuild the document with the text in the correct positions. if you want me to look at it any further, pm me

    pete

  7. #7

    Thread Starter
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Want to convert text in Text boxes to normal (without text boxes)

    Quote Originally Posted by westconn1
    point 1 the boxes in this document are frames as different to textboxes
    point 2 the frames are in order starting from some on the right hand side, centre lefthandside, then back to the right, and that is just in the heading area

    i believe it would be possible to do what you want, though at this stage i am not sure how, but the time to do it would be considerable, as the locaton of each frame would have to be stored with its text content to rebuild the document with the text in the correct positions. if you want me to look at it any further, pm me

    pete
    Thanks for your reply,

    I want to convert the same to the table format. So it will be easier to handle it. The exact position is not needed. but, no text content should be ignored. Pls look at the same. Thanks,

    CS.

  8. #8
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Want to convert text in Text boxes to normal (without text boxes)

    having looked at that i don't believe it is any easier to convert to table, at least to do in code, partly at least because it wouldn't be uniform table spacing all the way down

    it is easy enough to grab all the text, just a problem knowing where to put it, as all the positioning will have to be done with tabs and spaces, from the left hand side

    pete
    Last edited by westconn1; Jun 26th, 2005 at 07:24 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width