How to open Select Data Dialogue from office content add in (Content App)

77 Views Asked by At

How to open Select Data Dialogue from office content add in. Same Dialogue that open when

  1. Insert excel chart.
  2. Right click on chat.
  3. Select Data.
    enter image description here
1

There are 1 best solutions below

0
ozil On

Finally I found the answer
Office.context.document.bindings.addFromPromptAsync do the trick

Office.context.document.bindings.addFromPromptAsync(Office.BindingType.Table,
        {
            id: "you id",
            promptText: "your text"
        },
        function (asyncResult) {
            if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {
                if (asyncResult.value.columnCount < 2 || asyncResult.value.rowCount < 1) {
                    Office.context.document.bindings.releaseByIdAsync("DetailData");
                    myMessageBox.showErrorMessage("Insufficient detail data.");
                }
                else {
                    _detailDataBinding = asyncResult.value;
                    //do your work

                }
            }
        });