8
votes

There's a new text wrapping mode called Clip in the new Google Sheets.

getWraps()/setWraps() still works with boolean values. When I set wrap value to true, text in that cell is displayed in Overflow mode.

I've found no trace of any new function to set the text wrapping to Clip.

Does anybody know how to deal with that?

2

2 Answers

4
votes

There's new method available for setting text wrapping strategy: Range.setWrapStrategy(strategy)

Example:

// Sets all cells in range B2:D4 to use the clip wrap strategy.
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange("B2:D4");

range.setWrapStrategy(SpreadsheetApp.WrapStrategy.CLIP);
2
votes

Try to use copyTo(destination) paste a cell having the clip wrap mode to the destination cell, then change the other range properties.

Also star the Google Apps Script issue 5482 : Ability to set text wrapping mode to Clip.