Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not preserve bold formatting in cell #10

Open
hedges333 opened this issue May 23, 2018 · 2 comments
Open

does not preserve bold formatting in cell #10

hedges333 opened this issue May 23, 2018 · 2 comments

Comments

@hedges333
Copy link

hedges333 commented May 23, 2018

  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var conv = SheetConverter.init(ss.getSpreadsheetTimeZone(),
                               ss.getSpreadsheetLocale());

  
  for (var key in colNums) {
    var colNum = colNums[key];
    
    // use a range and preserve formatting with SheetConverter
    
    var range = thisSheet.getRange(rowNumber, colNum, 1, 1);
    
    var array = conv.convertRange2html(range);
    console.log("sheetconverter "+rowNumber+","+colNum+": "+JSON.stringify(array));
    // ...

See screenshots of original cell and the result...

capture

capture2

If I just use convertRange(range), it only seems to grab the plain text in the array.

Either way, it does not grab the formatting of the bold words. I don't really care about the background color. I just want the bold words.

This is a translation table for comic book dialog.

@rubenrivera
Copy link

@hedges333
Copy link
Author

Thanks Ruben, that's a good lead. Now if only I could insertRichTextValue into a Doc file... but there are still other deficiencies in Docs that don't seem to be able to be addressed. Widow/orphan control, and style settings to "keep with next" and "don't split paragraph." I decided I can't use this for what I need yet, so I switched to writing Python macros for LibreOffice Calc and Writer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants