OneNote Add-In page colours

Christopher Andrews 11 Reputation points
2022-05-02T12:28:41.033+00:00

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.
10,728 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.
173 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Zehui Yao_MSFT 5,831 Reputation points
    2022-05-03T02:27:30.65+00:00

    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  
    

    198396-image.png
    198310-image.png
    Here is the documentation for your reference: https://learn.microsoft.com/en-us/graph/api/section-post-pages?view=graph-rest-1.0
    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
    2022-05-03T06:29:24.867+00:00
    0 comments No comments