4

enter image description here

My taskpane is on URL https://presimax.in/testhome And dialog box is on https://presimax.in/word

Here is the code for dialog box,

<html>
    <head>
        <title></title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <!-- For the Office UI Fabric, go to http://aka.ms/office-ui-fabric to learn more. -->
        <link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/2.1.0/fabric.min.css">
        <link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/2.1.0/fabric.components.min.css">
        <link rel="stylesheet" href="Styles/index.css">

        <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.2.1.min.js"></script>

        <!-- Load the Office JavaScript libraries -->
        <script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript" crossorigin="anonymous"></script>

        
    </head>
    <body>
        <div class="ms-typeramp-dialog"> 
            <p class="ms-font-m">Please wait for this window to close, before continuing with the add-in ( changed ).</p> 
        </div>
        <script>
        setTimeout(() => {
          (function () {
            "use strict";
        
            // Office.initialize must be called on every page where Office JavaScript is 
            // called. Other initialization code should go inside it.
            Office.initialize = function() {        
                $(document).ready(function () {  
        
                    try {                
                        // Tell the task pane about the outcome.
                        Office.context.ui.messageParent("Test");
                    }
                    catch(err) { 
                        
                        // Create the outcome message and send it to the task pane.
                        var messageObject = {outcome: "failure", error: err.message};            
                        var jsonMessage = JSON.stringify(messageObject);
        
                        // Tell the task pane about the outcome.
                        Office.context.ui.messageParent("message to parent " + jsonMessage); 
                    }
                });
            }
        }());  
        }, 10000);
        </script> 
    </body>
</html>

This configuration throws an error OSF.DDA.Error code: 7000 message: "You don't have sufficient permissions for this action."

And also this warning,

"Tracking Prevention blocked access to storage for https://appsforoffice.microsoft.com/lib/1/hosted/office.js."

I don't know the reason, it was working initially for 2 months but now it is giving this error.

Thank you in advance.

bhavasagar
  • 91
  • 6
  • I don't think that the new parameter for messageParent should be needed in your scenario, but it can't hurt to try it. [Cross-domain messaging](https://learn.microsoft.com/en-us/office/dev/add-ins/develop/dialog-api-in-office-add-ins#cross-domain-messaging-to-the-host-runtime) – Rick Kirkham Oct 14 '21 at 17:50
  • Yes, I have tried that. Main problem is with storage warning and OSF.DDA error. – bhavasagar Oct 15 '21 at 02:41
  • Hi Bhavasagar Putta, could you resolve this problem? – Anselm Scholz Dec 20 '21 at 14:16
  • 1
    No, I wasn't able to resolve this insted without anyother option I have started using Websockets. Or you can also resolve this by using VSTO addin. – bhavasagar Jun 20 '22 at 15:24

0 Answers0