• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How get TableId in Document by FDK?

Enthusiast ,
Jul 14, 2015 Jul 14, 2015

Copy link to clipboard

Copied

My Code get Table, But it not working.

It only can get a Cell has content="FrameMaker Source Item"

This content not exist in my table.


tableId = F_ApiGetId(0, DocId, FP_FirstTblInDoc);

while ( tableId ) {

  firstrowId = F_ApiGetId(DocId, tableId, FP_FirstRowInTbl);

  while ( firstrowId ) {

  cellId = F_ApiGetId(DocId, firstrowId, FP_FirstCellInRow);

    while ( cellId ) {

      cellId = F_ApiGetId(DocId, firstrowId, FP_NextCellInRow);

    }

  firstrowId = F_ApiGetId(DocId, tableId, FP_NextRowInTbl);

  }

  tableId = F_ApiGetId(FV_SessionId, DocId, FP_NextTblInDoc);

  }

  }


How get TableId in Document  by FDK?

TOPICS
Scripting

Views

474

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Jul 15, 2015 Jul 15, 2015

diatranthanhoa,

I don't understand your question. But if you are trying to iterate over all cells in every table, you have errors in your code. They are common mistakes. The errors are:

- FP_NextTblInDoc is a property of a table object, not the document

- FP_NextRowInTbl is a property of a row object, not the table

- FP_NextCellInRow is a property of a cell object, not the row

So, I would adjust your code as follows, noting that I did not test this:

tableId = F_ApiGetId(0, DocId, FP_FirstTblInDoc);

whi

...

Votes

Translate

Translate
Mentor ,
Jul 15, 2015 Jul 15, 2015

Copy link to clipboard

Copied

diatranthanhoa,

I don't understand your question. But if you are trying to iterate over all cells in every table, you have errors in your code. They are common mistakes. The errors are:

- FP_NextTblInDoc is a property of a table object, not the document

- FP_NextRowInTbl is a property of a row object, not the table

- FP_NextCellInRow is a property of a cell object, not the row

So, I would adjust your code as follows, noting that I did not test this:

tableId = F_ApiGetId(0, DocId, FP_FirstTblInDoc);

while ( tableId ) {

  firstrowId = F_ApiGetId(DocId, tableId, FP_FirstRowInTbl);

  while ( firstrowId ) {

  cellId = F_ApiGetId(DocId, firstrowId, FP_FirstCellInRow);

    while ( cellId ) {

      cellId = F_ApiGetId(DocId, cellId, FP_NextCellInRow);

    }

  firstrowId = F_ApiGetId(DocId, firstrowId, FP_NextRowInTbl);

  }

  tableId = F_ApiGetId(DocId, tableId, FP_NextTblInDoc);

  }

  }

Hope this helps,

Russ

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 12, 2016 May 12, 2016

Copy link to clipboard

Copied

Hi! I use the same code but I want to skip tables from non Body Pages. How can I do that?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
May 12, 2016 May 12, 2016

Copy link to clipboard

Copied

Hi Ch, please avoid reviving these old threads for loosely-related followup questions. I realize you are just looking for help, but it makes it difficult to keep things organized for readers and contributors alike. Please refer to your current post for this issue:

How to filter tables from body pages only?

Russ

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 12, 2016 May 12, 2016

Copy link to clipboard

Copied

LATEST

OK Russ.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines