Share via

Word to PDF GraphAPI Conversion

ShahulHameed M (TMNA) 0 Reputation points
2025-10-20T23:29:48.5066667+00:00

Hi Team,

We are using Azure GraphAPI to convert word to pdf, however we need docm file type not included in the conversion, do we have any future plan to include docm file type in this graphAPI conversion.

It would be great if you share some insights on this, when we try converting docm to pdf we are getting file type error. Kindly assist..

Thanks

Microsoft Security | Microsoft Graph
0 comments No comments

1 answer

Sort by: Most helpful
  1. Dio Xavier 284.7K Reputation points Volunteer Moderator
    2025-10-20T23:36:50.1833333+00:00

    Hello there,

    Welcome to Microsoft Q&A Azure

    At the moment, Microsoft Graph API does not support direct conversion of .docm (Word macro-enabled) files to .pdf. This is expected behavior, as the file conversion endpoint (/drive/items/{item-id}/content?format=pdf) only supports standard Word formats such as .docx. You can find the documentation here: Microsoft Graph API – DriveItem: Content

    The technical reason is that .docm files contain VBA macros, which can pose security risks and are not processed by Microsoft 365 cloud-based services. Therefore, the API intentionally blocks direct conversion of these files.

    As a workaround, you can:

    Save or convert the file to .docx before submitting it to the Graph API — this can be done in Word desktop, via Power Automate, or programmatically using Microsoft Graph or Office Scripts.

    If retaining macros is required, perform the conversion locally using Word Interop or Office Scripts in Excel Online, which allow more control over macro-enabled content.

    Currently, there is no public roadmap indicating future support for .docm conversion in Graph API. You can stay updated by following: Microsoft Graph changelog and submit a feature request here: Microsoft Graph Feedback Portal

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.