3 Replies Latest reply: Oct 19, 2012 2:29 AM by 4everJang RSS

    Convert Table to Text

    Jason L-S Community Member

      I cannot find a method in the framemaker scripting guide for the Table > Convert to Paragraphs command.

       

      I found a suspicious Fcode command: FCodes.KBD_TABLE_CONVERT. Not so great. I  neither like Fcodes, nor do think this would do what I want.

       

      Advice?

       

      Thanks,

       

      Jason

        • 1. Re: Convert Table to Text
          frameexpert Community Member

          You basically have to loop through the table and write out the content to paragraphs the way you want them and then delete the table. I haven't found a way to access the actual Table > Convert to Paragraphs command.

           

          Rick

          • 2. Re: Convert Table to Text
            jlangkamer Community Member

            Rick,

             

            Do you have a code example to help get me started, to show how I would write out the content of the paragraphs?

             

            I also thought I could use the Copy and Paste commands. I set the text range to the beginning paragraph and ending paragraph of a cell, then copy.

             

            Then I set a new text range in the document where I want the text to go and paste.

             

            But how do I then get the paragraph object(s) for each of those newly pasted paragraphs?

             

            Thanks,

             

            Jason

            • 3. Re: Convert Table to Text
              4everJang Community Member

              Jason,

               

              When you have copied the text range from the table cell, go to where you want to paste the materials, then insert a new paragraph, set the text location to the start of that new paragraph and paste. From the new paragraph, you should be able to find all new paragraphs as they are linked through their NextPgf properties. For each of the pasted paragraphs, apply the correct paragraph format (as it will probably be a table cell format and you will want to use some kind of body format instead.

               

              Good luck

               

              Jang