Drag and drop messages and file attachments into the add-in task pane.
+To learn more about the drag-and-drop feature, see Drag and drop messages and + attachments into the task pane of an Outlook add-in.
+Required mode: Compose or Read
+Supported Outlook clients: Outlook on the web and the new Outlook on Windows
+cCvpffwJHUJG`a5}0tLeASH7f!!jtUr8o(qJ48udQc_E*y9aGTn!;6g+ zo>R@QbZg)pm6Gj5>Tws^NW)qqW+8tv3YSn$esN-nd}b&xQ`pG7ve}2>MbWNegR!ux z6zhbEf(^GjNJ(G%Cfkv0Me8^#aOz1{8|&>9?itzrKzsXFzWGmfeAPVTYG4a{QuO6+ zd3}2GZ=hAR^$Cs}TaFU!({-Cg;&lqWgTFi6gZ7_#0WDir~hO4(bgtO>GtTevFH_ zs+~9q8VpgmYi&1rkGwD4Wa@$IOo({JOB7!-N?`J5q|kIo>5Y#in*RNEQ{Ig8B?5mW zpB!3oBji}^dYdxKVa=_;KNb{6!G83!Y>T*fu?1QSIb2X}U84Qts%u#E_EHH{?{Z16 z@p8Tz#oXq8_L!k4%{55${cAw}Gr!d&dFQgUer%Bq52ArMdSq4j zr$~S>q7$`AP5=f?OTocp+7m@+x{LN4Jt}y>s%oew%G;DYL=vCD;nB$VBLy=DCU9dG z!HSH8D?;)KG+JTwd1<~r1VUTH**!ay-2nXdsqEv#Qg1_nis~oBYnJo17QwJh`LLvrt zJ5H8=x2tj2MA&)%N(wU_{If+~pVDDj^3^hnFm}Z5jx<}Lll@lk;kR^?!&84I6}pxw z752u6UnBxS+aM>(6CYewGRvmD-0)Ryw!U8BEwPn9ioF0PVj}|4Ir6jC=wjCUdGB}= zF6?*@eat#nIT3hxy(yF^r1)lKDPp=<7bD6+fYp*Qx}z=ZGw*?Hddi&{*_kLwe>~wg z3V *&54EM)K=58qhHW`1b!H-iv{u z$xX`=zYBWr{r%jqJfz+}_0u80kKjP&3I||#kYe)ca%wf%Gdp3su{t9M7idXws9=7> z`3g18_~Ekj%O`6(3a#imxPtW_gRMO4Q^&X~rgG#UrBu(20kD2z!$L(5Oob*)hPS$w zNHQ=B8PNB2B@+zuHV>JsR3&%Q8Bp#X6JFQp`)3e>ZZ`pv {Y8 7+NGq%*Cf%`U}KaQL3 z&%ubjhiXVwz#VGp$i8F0=C{k*jRSxYgo$2Yan)V_;Bvz-#h~~bY6qeIKyrvTMf%Ze z^^+xg?r&7n;!PW0$U5cEDz%>4K&g*EV&_a@*#cjYIWT!G6-NlC3ylZ@5!poqdwl)v zEaL7g2D#D1rBcj;0~0o|4UU^@+snTsnxX{| Jk!W5n4Z${Wd%Bx;E7PmJ z@9)?
bK4S9<=eg6z>p&V!e(v-aECWYZ$*Qj(w7XR3K!~U_?C4w}L1?#qz0o}L%O!;R z=Ti`b^&0MMcc0=DOjhKrbGkr6)Agof!xt&+_~qDGwid1T9wxg3liMjX{ }}~!tis(&+Cc8^b5oj=#!KDzZ+mEDBS;h^uG&9k@y%<{CEp}2AI9C@c|&5 z_#%B?7+kskU0&%6!i31jV<}R{tAQ9`vJ~F$s=*X0#xH>QN&Y8X?>#JV2>*YZ+)D9X z%J}j1`k3)Q3_ilxe~-5}VEo^Nh|e^@hlx{(Z!{2wAyA9IF%W{8(}?FZq(->b{x6#U E2SE{?AOHXW diff --git a/snippet-extractor-output/snippets.yaml b/snippet-extractor-output/snippets.yaml index ee07a923e..e4de5bfb1 100644 --- a/snippet-extractor-output/snippets.yaml +++ b/snippet-extractor-output/snippets.yaml @@ -11153,6 +11153,141 @@ Office.DisplayedSubject#setAsync:member(2): console.log("Temporarily set the content displayed in the subject field."); }); +Office.DragAndDropEventArgs:interface: + - >- + // Link to full sample: + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/80-events/drag-drop-item.yaml + + + function dragAndDropEventHandler(event) { + Office.context.mailbox.addHandlerAsync(Office.EventType.DragAndDropEvent, (event) => { + console.log(`Event type: ${event.type}`); + + const eventData = event.dragAndDropEventData; + console.log(`x-coordinate: ${eventData.pageX}, y-coordinate: ${eventData.pageY}`); + + if (eventData.type == "drop") { + console.log("Items dropped into task pane."); + const files = eventData.dataTransfer.files; + files.forEach((file) => { + const content = file.fileContent; + const name = file.name; + const fileType = file.type; + console.log(`File name: ${name}`); + console.log(`File type: ${fileType}`); + console.log(`Contents: ${content.text().then((text) => { console.log(text); })}`); + }); + } + }); + } +Office.DragoverEventData:interface: + - >- + // Link to full sample: + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/80-events/drag-drop-item.yaml + + + function dragAndDropEventHandler(event) { + Office.context.mailbox.addHandlerAsync(Office.EventType.DragAndDropEvent, (event) => { + console.log(`Event type: ${event.type}`); + + const eventData = event.dragAndDropEventData; + console.log(`x-coordinate: ${eventData.pageX}, y-coordinate: ${eventData.pageY}`); + + if (eventData.type == "drop") { + console.log("Items dropped into task pane."); + const files = eventData.dataTransfer.files; + files.forEach((file) => { + const content = file.fileContent; + const name = file.name; + const fileType = file.type; + console.log(`File name: ${name}`); + console.log(`File type: ${fileType}`); + console.log(`Contents: ${content.text().then((text) => { console.log(text); })}`); + }); + } + }); + } +Office.DropEventData:interface: + - >- + // Link to full sample: + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/80-events/drag-drop-item.yaml + + + function dragAndDropEventHandler(event) { + Office.context.mailbox.addHandlerAsync(Office.EventType.DragAndDropEvent, (event) => { + console.log(`Event type: ${event.type}`); + + const eventData = event.dragAndDropEventData; + console.log(`x-coordinate: ${eventData.pageX}, y-coordinate: ${eventData.pageY}`); + + if (eventData.type == "drop") { + console.log("Items dropped into task pane."); + const files = eventData.dataTransfer.files; + files.forEach((file) => { + const content = file.fileContent; + const name = file.name; + const fileType = file.type; + console.log(`File name: ${name}`); + console.log(`File type: ${fileType}`); + console.log(`Contents: ${content.text().then((text) => { console.log(text); })}`); + }); + } + }); + } +Office.DroppedItems:interface: + - >- + // Link to full sample: + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/80-events/drag-drop-item.yaml + + + function dragAndDropEventHandler(event) { + Office.context.mailbox.addHandlerAsync(Office.EventType.DragAndDropEvent, (event) => { + console.log(`Event type: ${event.type}`); + + const eventData = event.dragAndDropEventData; + console.log(`x-coordinate: ${eventData.pageX}, y-coordinate: ${eventData.pageY}`); + + if (eventData.type == "drop") { + console.log("Items dropped into task pane."); + const files = eventData.dataTransfer.files; + files.forEach((file) => { + const content = file.fileContent; + const name = file.name; + const fileType = file.type; + console.log(`File name: ${name}`); + console.log(`File type: ${fileType}`); + console.log(`Contents: ${content.text().then((text) => { console.log(text); })}`); + }); + } + }); + } +Office.DroppedItemDetails:interface: + - >- + // Link to full sample: + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/80-events/drag-drop-item.yaml + + + function dragAndDropEventHandler(event) { + Office.context.mailbox.addHandlerAsync(Office.EventType.DragAndDropEvent, (event) => { + console.log(`Event type: ${event.type}`); + + const eventData = event.dragAndDropEventData; + console.log(`x-coordinate: ${eventData.pageX}, y-coordinate: ${eventData.pageY}`); + + if (eventData.type == "drop") { + console.log("Items dropped into task pane."); + const files = eventData.dataTransfer.files; + files.forEach((file) => { + const content = file.fileContent; + const name = file.name; + const fileType = file.type; + console.log(`File name: ${name}`); + console.log(`File type: ${fileType}`); + console.log(`Contents: ${content.text().then((text) => { console.log(text); })}`); + }); + } + }); + } Office.EnhancedLocation#addAsync:member(1): - >- // Link to full sample: diff --git a/view-prod/outlook.json b/view-prod/outlook.json index d9564fc71..9b861d008 100644 --- a/view-prod/outlook.json +++ b/view-prod/outlook.json @@ -47,6 +47,7 @@ "outlook-mime-headers-get-internet-headers-message-read": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/70-mime-headers/get-internet-headers-message-read.yaml", "outlook-mime-headers-manage-custom-internet-headers-message-compose": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/70-mime-headers/manage-custom-internet-headers-message-compose.yaml", "outlook-regex-matches-contextual": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/75-regex-matches/contextual.yaml", + "outlook-events-drag-drop-item": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/80-events/drag-drop-item.yaml", "outlook-tokens-and-service-calls-ids-and-urls": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/85-tokens-and-service-calls/ids-and-urls.yaml", "outlook-tokens-and-service-calls-user-identity-token": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/85-tokens-and-service-calls/user-identity-token.yaml", "outlook-tokens-and-service-calls-user-callback-token": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/85-tokens-and-service-calls/user-callback-token.yaml", diff --git a/view/outlook.json b/view/outlook.json index bdd41f2b7..7d57d08cb 100644 --- a/view/outlook.json +++ b/view/outlook.json @@ -47,6 +47,7 @@ "outlook-mime-headers-get-internet-headers-message-read": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/70-mime-headers/get-internet-headers-message-read.yaml", "outlook-mime-headers-manage-custom-internet-headers-message-compose": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/70-mime-headers/manage-custom-internet-headers-message-compose.yaml", "outlook-regex-matches-contextual": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/75-regex-matches/contextual.yaml", + "outlook-events-drag-drop-item": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/80-events/drag-drop-item.yaml", "outlook-tokens-and-service-calls-ids-and-urls": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/85-tokens-and-service-calls/ids-and-urls.yaml", "outlook-tokens-and-service-calls-user-identity-token": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/85-tokens-and-service-calls/user-identity-token.yaml", "outlook-tokens-and-service-calls-user-callback-token": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/85-tokens-and-service-calls/user-callback-token.yaml",