Graph API for Microsoft word

niranjan singh 0 Reputation points
2023-11-13T14:40:50.3133333+00:00

Hi Support,

I have to read a MS Word template that has bookmarks for dynamic data. I need to update values in bookmarks using Graph API, please let me know if API is available to create/update MS word document.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,072 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sourabh Gupta 795 Reputation points Microsoft Vendor
    2023-11-19T13:53:01.3133333+00:00

    Hi @niranjan singh

    As of today, there is no Word API available under the Microsoft Graph

    Only thing that can be done using Graph API is managing the drive item and its permissions, when the file is residing in SharePoint/OneDrive for Business.

    However, what you can try is editing the word file using Interop assemblies.

    Reference link: https://learn.microsoft.com/en-us/visualstudio/vsto/office-primary-interop-assemblies?view=vs-2022

    The steps can be as follows

    Following link can be referred to update bookmarks in a word document

    https://learn.microsoft.com/en-us/visualstudio/vsto/how-to-programmatically-update-bookmark-text?view=vs-2022&tabs=csharp

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments