OneNote Add-In page colours

Christopher Andrews 16 Reputation points

Good afternoon,

I'm developing a task-pane add-in for our school and one of the requirements is that we set a standard page colour. I'm trying to do this, however, I can't see how to change the page colour using the JavaScript API. I've followed the first onenote task tutorial and I've managed to change inline css for paragraphs/tables etc. but I just can't get the page colour to change. I am developing it for OneNote online as we can't develop for UWP yet.

Am I missing something or is it not possible?

Many thanks,
Chris Andrews

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,382 questions
OneNote Management
OneNote Management
OneNote: A family of Microsoft products that enable users to capture, organize, and reuse notes electronically.Management: The act or process of organizing, handling, directing or controlling something.
174 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Zehui Yao_MSFT 5,846 Reputation points

    Hello @Christopher Andrews , using microsoft graph, you can create pages through the following APIs, which support adding HTML files to your pages.

    POST /me/onenote/sections/{id}/pages  
    POST /users/{id | userPrincipalName}/onenote/sections/{id}/pages  
    POST /groups/{id}/onenote/sections/{id}/pages  
    POST /sites/{id}/onenote/sections/{id}/pages  

    Here is the documentation for your reference:
    Hope this helps you.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

  2. Linda Gray 1 Reputation point
    0 comments No comments