microsoft-graph-apimicrosoft-graph-sdksmicrosoft-graph-excel

How to format characters in Excel using Graph? (not all characters in cell)


I want to update cells in an Excel file to look like this:

enter image description here

A background color of my choosing with the last two characters in the cell bold and larger font size.

I'm reading the 'Update a range format in Excel' documentation and updating colors and fonts of a cell is possible, for example:

PATCH https://graph.microsoft.com/v1.0/me/drive/items/{id}/workbook/worksheets/Sheet1/range(address='$A$1')/format/font
Content-type: application/json

{
  "bold": true,
  "color": "#4B180E",
  "size": 26
}

However, I can't find how to manipulate characters (not the entire cell) in the documentation. Is it possible to do this in Micrsoft Graph, and if so how?


Solution

  • The Graph API doesn't expose any endpoint that will allow you to format part of the text inside the cell.

    The issue is that formatting of individual characters in a cell is not supported by underlying js API.

    https://github.com/OfficeDev/office-js/issues/4623