#1
|
|||
|
|||
Macros to convert text to Table
Hi Friends,
I would like to ask your help on how to convert text to table using macros. I receive the text like this: Text1 text2. Some/text. [text3] This is just an example. We need to create table with four (4) columns. “Text1” will be on the second column. “text2. Some/text. [text3] This is just an example.” Will be on the fourth column. This really help me to speed up the work. Thanks |
#2
|
||||
|
||||
In order to determine whether this is possible, it would be better if you supplied an actual sample (with several lines of text), as your example is meaningless.
If Word's own text to table function doesn't work it suggests there is no consistent format between the lines of text. In order for a macro to be able to split the paragraphs into table cells there has to be a consistently available point which the macro can establish. There does not appear to be any such consistency in your example.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Attached here is a sample file
|
#4
|
||||
|
||||
I don't think it is possible to come up with a solution that will convert the document to a table.
The document is formatted using frames to make up the columns. If you processed each frame separately, even in this extract the data is split between frames e.g. the first part of the second frame belongs to the end of the last part of the first frame. If you remove the frames it creates a different set of problems. The individual segments are not consistently formatted. Some have multiple paragraph breaks within a segment, others have different amounts of information. I regret I can see no way to make this task easier using vba.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
I need to convert shaded text into highlighted text on about 80 different long documents. VBA macro? | AustinBrister | Word VBA | 8 | 05-28-2015 02:42 PM |
Convert Text To Table: Separate text at (Other)? | tinfanide | Word VBA | 2 | 01-12-2015 05:26 AM |
Convert image-text hybrids into plain text | morlack | Excel | 4 | 12-03-2014 05:29 PM |
Convert graphic to text in a table | Jennifer Murphy | Word | 6 | 01-24-2013 12:56 PM |
My plain text post got converted to rich text in a reply, how to convert it back? | david.karr | Outlook | 0 | 01-05-2012 09:46 AM |