Ich versuche displayDialogAsync Methode durch den folgenden Link, https://channel9.msdn.com/Shows/Office-Dev-Show/Office-Dev-Show-Episode-26-Using-the-Dialog-API-in-Office-Add-ins Als ich das Projekt von GitHub zu testen, habe ich einen Fehler „Zugriff verweigert Fehler“ bei Office.context.ui. displayDialogAsync. Hier ist ein einfacher Code:Office.context.ui.displayDialogAsync Permission Fehler verweigert
function ShowDialog() {
// Reference the Form.html file.
var dialogUrl = 'https://' + location.host + '/Form.html';
// Display the dialog.
Office.context.ui.displayDialogAsync(dialogUrl, { width: 15, height: 27, requireHTTPS: true }, function (asyncResult) {
if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
// TODO: Handle error.
return;
}
// Get the dialog and register event handlers.
var dialog = asyncResult.value;
dialog.addEventHandler(Microsoft.Office.WebExtension.EventType.DialogMessageReceived, function (asyncResult) {
if (asyncResult.type !== Microsoft.Office.WebExtension.EventType.DialogMessageReceived) {
// TODO: Handle unknown message.
return;
}
// Parse the message.
var data = JSON.parse(asyncResult.message);
showNotification('Hello #Office365Dev', data.name);
// TODO: Do something with the data.
// We got our data, time to close the dialog.
dialog.close();
});
});
}
Vielen Dank für Ihre Hilfe.
Dank für Ihre Hilfe. Ich habe einen Test mit Office 2016 MSI-Version gemacht, ich werde versuchen zu prüfen, ob es in Click-to-Run-Version verfügbar ist. –
Für MSI-Versionen sollte die API mit der Mai-Aktualisierung verfügbar sein. –