Share via

compareFromBase64 does not work in Windows desktop Word and neither in Word online

RahulK 20 Reputation points
2026-02-05T14:18:33.7866667+00:00

Problem Statement :

We have a requirement to compare the currently opened document with a second document(which has some additional changes).

Current Approach :

We are using the method compareFromBase64 to compare between the two documents via base64.

Issue :

We keep getting RichApiException while using the above method in Windows desktop Word version. Please note that the same method works seamlessly in Mac desktop Word version.

Requirement :

We need to be able to compare the documents in Windows as well as Mac desktop Word versions. From what we saw, Word online does not support this. If however, there is a way to make this work for online as well, please suggest the way to achieve that.

Version Info :

Office version: 16.0.16731.21114 (on Windows desktop Word)

Microsoft 365 and Office | Development | Office JavaScript API
{count} votes

Answer accepted by question author
  1. Jack-Bu 6,675 Reputation points Microsoft External Staff Moderator
    2026-02-05T14:57:24.6+00:00

    Hello RahulK

    Thank you for reaching out to Microsoft Q&A.

    Based on the information you described, I understand that you are attempting to compare the currently opened Word document with another document using the compareFromBase64 method. This works correctly on Word for Mac (desktop) but consistently throws a RichApiException on Word for Windows (desktop). Your requirement is to support document comparison on both Windows and Mac desktop versions, and ideally also on Word for the web if possible.

    After researching, the compareFromBase64 method is part of the Word JavaScript API (WordApiDesktop requirement set) and is not supported in Word Online. Word for the web does not provide any native Office.js API for document comparison, and there is currently no workaround within Office JS to enable this functionality online.

    If document comparison is required for Word Online, the recommended approach is server-side processing, for example:

    Export the currently opened document using getFileAsync (OOXML) > Send that content along with the second document’s Base64 to a backend service > Perform the comparison using Open XML SDK or a third-party document comparison library.

    The compareFromBase64 method belongs to WordApiDesktop 1.2, which is only available in newer Microsoft 365 builds for Windows.

    This method requires:

    • Microsoft 365 Version 2502
    • Build 18526.20144 or later

    Your current Windows version does not yet support this requirement set, which explains the RichApiException (the API does not exist on that host version). So, please update Office on Windows to the latest Microsoft 365 build and retest.

    I hope this clarifies the behavior you’re seeing and helps you move forward. If you need help, please feel free to let me know.


    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.


1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2026-02-05T14:18:48.1033333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The compareFromBase64 method is designed to compare documents, but it appears that there are limitations when using it in the Windows desktop version of Word. The RichApiException you are encountering indicates that the method may not be fully supported or there may be specific requirements or conditions that are not being met in the Windows environment.

    Since you mentioned that the method works seamlessly on the Mac version, it suggests that there may be differences in API support between the platforms. Unfortunately, as of the current information, Word Online does not support the compareFromBase64 method either.

    To address your requirement for comparing documents on both Windows and Mac, you might consider the following alternatives:

    1. Check for Updates: Ensure that your Windows version of Word is updated to the latest version, as updates may include fixes or enhancements to API support.
    2. Use Alternative Comparison Methods: If compareFromBase64 is not viable on Windows, explore other methods available in the Word JavaScript API that may allow for document comparison.
    3. Contact Microsoft Support: If this is a critical feature for your application, reaching out to Microsoft support for guidance on the RichApiException and potential workarounds could provide additional insights.

    For now, the functionality you seek may not be fully available across all platforms, and it may require adjustments in your approach depending on the environment you're working in.

    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.