Highlighted

How get TableId in Document by FDK?

Enthusiast ,
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?

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

TOPICS
Scripting

Views

340

Likes

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

How get TableId in Document by FDK?

Enthusiast ,
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?

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

TOPICS
Scripting

Views

341

Likes

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
Jul 14, 2015 0
Mentor ,
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

Likes

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
Reply
Loading...
Jul 15, 2015 1
Participant ,
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?

Likes

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
Reply
Loading...
May 12, 2016 0
Mentor ,
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

Likes

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
Reply
Loading...
May 12, 2016 0
Participant ,
May 12, 2016

Copy link to clipboard

Copied

OK Russ.

Likes

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
Reply
Loading...
May 12, 2016 0