FM Doesn't Cut it Out...
Hi everyone,
I have a script that formats tables that are imported as RTF. Everyone on my team loves it, but it doesn't work for one colleague.
Part of the script cuts the first row of the table, adds a heading row, and then pastes into that heading row. The problem for my colleague is that it's pasting whatever is on his clipboard before he ran the script. So, in essence, it's not doing the cut properly.
I thought it might be related to his INI file, but when I took his file and used it as my own, I didn't have any trouble.
Are there any other environmental settings that would prevent the CUT operation from working properly?
Thank y'all!!!
Heather A
**Also, if anyone is interested in the script, I'm happy to share. Just let me know.
Here's the code that handles the cutting and pasting just in case I'm doing something dumb and it just happens to be working for some people:
//Get the number of columns, but remember to subtract 1 for
//MakeTblSelection function which indexes from 0.
var num_columns = textItems.obj.TblNumCols -1;
//Add a new row to be used as the heading row
var row = textItems.obj.FirstRowInTbl;
row.AddRows(Constants.FV_Heading, 1); //Adds a heading row
//These 4 lines, select the now second row and cut it to the clipboard.
//This row was the original header row from the Word table.
//Next, paste the information to the new heading row
textItems.obj.MakeTblSelection(1, 1, 0, num_columns);
doc.Cut(Constants.FF_CUT_TBL_CELLS);
textItems.obj.MakeTblSelection(0, 0, 0, num_columns);
doc.Paste(Constants.FF_REPLACE_CELLS);
var row = textItems.obj.FirstRowInTbl;
//These two lines resize the table so that it fits into the 6.47 in page.
scaledColWidths = scaleTblMetrics(textItems.obj, targetTbleWidth);
textItems.obj.TblColWidths = scaledColWidths;
ApplyTableFormat(textItems.obj, doc);
ApplyTableTitle(textItems.obj,doc);
ApplyCellHeadingParaTag(textItems.obj, "CellHeading");
// AdjustWidth(textItems.obj,doc);
ApplyFullTableParaTag(textItems.obj, FullTablePgfTag);
cntTables++;
