Copy link to clipboard
Copied
Tables come up with a title of "Table 1:", how do I change that to be more meaningful like "Sale Projections by Region"?
//Create the table
var textLoc, tbl;
textLoc = new TextLoc (doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf, 0);
// NewTable(format, numCols, numBodyRows, numHeaderRows, numFooterRows, textLoc)
tbl = doc.NewTable ("Format A", 4, 10, 1, 0, textLoc);
//Change the table title from "Table 1:" to "Sale Projections by Region"
???
The table title is like any other FrameMaker paragraph: it has a Paragraph Format applied to it. Typically, you would redefine the autonumber properties for the table's title paragraph format so that it matches what you want. In your case, you may just want to remove the autonumber and then add the correct text depending on the table's contents. For a table containing the cursor, here is how you add text to the table title.
...#target framemaker
var doc, tbl, textLoc, pgf;
doc = app.ActiveDoc;
tbl = do
Copy link to clipboard
Copied
The table title is like any other FrameMaker paragraph: it has a Paragraph Format applied to it. Typically, you would redefine the autonumber properties for the table's title paragraph format so that it matches what you want. In your case, you may just want to remove the autonumber and then add the correct text depending on the table's contents. For a table containing the cursor, here is how you add text to the table title.
#target framemaker
var doc, tbl, textLoc, pgf;
doc = app.ActiveDoc;
tbl = doc.SelectedTbl;
// Get the table's title paragraph.
pgf = tbl.FirstPgf;
// Make a TextLoc and add the desired title.
textLoc = new TextLoc (pgf, 0);
doc.AddText (textLoc, "Sale Projections by Region");
Copy link to clipboard
Copied
Gene, if you are satisfied with my answers, please mark them as Correct. I answered some of your other questions, but you did not mark them as Correct. I would appreciate if you would. Thank you.
Copy link to clipboard
Copied
I am sorry about that. You marked it correct as I was posting my request. Thank you very much!