question

ChristopherAndrews-8701 avatar image
0 Votes"
ChristopherAndrews-8701 asked CarlZhao-MSFT commented

OneNote Add-In page colours

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

office-onenote-client-itpromicrosoft-graph-notes
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ZehuiYaoMSFT-7151 avatar image
0 Votes"
ZehuiYaoMSFT-7151 answered CarlZhao-MSFT commented

Hello @ChristopherAndrews-8701, 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://docs.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.


image.png (190.0 KiB)
image.png (182.4 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @ChristopherAndrews-8701, did the answer above help? Please comment here if you have any questions

0 Votes 0 ·

Hi @ChristopherAndrews-8701, would you mind providing an update on the status of this issue? Comment here when you still need any help.

0 Votes 0 ·
LindaGray-0393 avatar image
0 Votes"
LindaGray-0393 answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.