Ich füge einen "Anhang hinzufügen" -Befehl als Teil eines Office Outlook-Add-Ins hinzu.Office Outlook-Add-In Hinzufügen eines Anhangs von einem sicheren Speicherort aus
Ich möchte einen Weg finden, Datei von einer URL mit der Berechtigung hinzuzufügen.
Ich dachte, es mit Ajax herunterladen und dann von einem Blob speichern, aber sieht aus wie der Befehl wird es nicht unterstützen. Mein Code es Tests, die fehlschlägt:
const text = 'attachment content';
const blob = new Blob([text], {type: 'text/plain'});
const attachmentURI = window.URL.createObjectURL(blob);
Office.context.mailbox.item.addFileAttachmentAsync(
attachmentURI,
'file.txt',
{ asyncContext: null },
function (asyncResult) {
if(asyncResult.status == Office.AsyncResultStatus.Failed){
console.log('error adding attachment: ' + asyncResult.error.message);
}
else {
const attachmentID = asyncResult.value;
console.log('added attachment: ' + attachmentID);
}
}
);
Irgendwelche Vorschläge auf Speichern einer Anlage aus einer URL mit Berechtigungen?
Funktionsdokumentation: https://dev.office.com/docs/add-ins/outlook/add-and-remove-attachments-to-an-item-in-a-compose-form
Hinweis: Wenn dies eine Funktion ist, für die Sie keine Problemumgehung finden können, sollten Sie Vorschläge für neue APIs unter folgender Adresse machen: https://officespdev.uservoice.com/forums/224641-general/category/131778 -add-in-ausblick –