Different way to convert text to table

User avatar
Sam1085
3StarLounger
Posts: 318
Joined: 23 Aug 2016, 07:43
Location: Sri Lanka

Different way to convert text to table

Post by Sam1085 »

Hi,

I've a table of content as follows:
img1.png
Test Document:
Test Document.docx
I've to cut this TOC content and paste them into a new excel file by using a word macro. (Please see below screenshot.)
img2.png
Then I have to copy it again and paste into word file. Finally I've to close the excel file without save.

Purpose is I've to convert text to table. Because reference TOC's not rendering HTML properly. Therefore I've to convert the entire TOC to table.
What i need is, I've no idea about how to run a word macro in excel.
(Cut from word > Paste to excel > Copy from excel > Paste to Word > Close excel file)

Then I can fix table formatting (Table width, Column width, Cell margins...etc.) by using other word macros.

I think this is the best method to convert this type of TOC's more than 90% accurately. Please let me know is there any other best and simple solution for this?
Thanks!
You do not have the required permissions to view the files attached to this post.
-Sampath-

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Different way to convert text to table

Post by Rudi »

Is the TOC you are working with an actual TOC (in other words, is it a field code?)
The TOC in your attached document is not a field but just tabbed text. This can be converted into a table without the need for Excel. Just select it and from the INSERT ribbon, choose Table, Convert Text to Table.

BTW: You can use Ctrl+Shift+F9 to convert a field code TOC to text, and then convert to a table too.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
Sam1085
3StarLounger
Posts: 318
Joined: 23 Aug 2016, 07:43
Location: Sri Lanka

Re: Different way to convert text to table

Post by Sam1085 »

Thanks Rudi,

Yes, in my original documents have field codes. Earlier I tried convert text to table, without unlink field codes. But it's not convert properly.

Your method is correct. Thanks!
-Sampath-