OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
668 stars 95 forks source link

Outlook Event-based Activation: not working on Windows #3758

Open kdeclerck opened 11 months ago

kdeclerck commented 11 months ago

Your Environment

The issue

I have a simple Outlook add-in which I generated with the Yeoman generator for Office Add-ins. I configured it for Event-based activation and added the OnMessageSend LaunchEvent. On web this works for me, on Windows it just keeps showing the "Add-in is processing your request" message (which eventually times out) when sending a new email. Note that I'm using the npm start command along with the webpack dev server as generated with Yeoman. My app also has commands and a taskpane, this all works fine. In "Office\16.0\Wef{CC8D0873-D4CF-47C8-B66C-9C2A70DF999B}\QWcROHV+7dD0Z+R2KQ6NtA==\Javascript\9566c1b4-341c-4e21-944d-2eb892ecd61e_1.0.0.0_en-US" I do see my bundle.js, which looks fine. I even reduced it to a super simple file. This is the entire file (exactly the same in the cached bundle.js as when requesting https://localhost:3000/launchevent.js):

function onMessageSendHandler(event) {
  return event.completed({ allowEvent: true });
}

if (Office.context.platform === Office.PlatformType.PC || Office.context.platform == null) {
    Office.actions.associate("onMessageSendHandler", onMessageSendHandler);
}

But even with this simple launchevent.js it doesn't fire the event.

This is what my manifest looks like:

<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
           xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
    <Id>9566c1b4-341c-4e21-944d-2eb892ecd61e</Id>
    <Version>1.0.0.0</Version>
    <ProviderName>Salesflare</ProviderName>
    <DefaultLocale>en-US</DefaultLocale>
    <DisplayName DefaultValue="Salesflare"/>
    <Description DefaultValue="Outlook add-in for Salesflare"/>
    <IconUrl DefaultValue="https://localhost:3000/assets/sf-icon.png"/>
    <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/sf-icon.png"/>
    <SupportUrl DefaultValue="https://howto.salesflare.com"/>
    <AppDomains>
        <AppDomain>https://localhost:3000</AppDomain>
        <AppDomain>https://localhost:8000</AppDomain>
    </AppDomains>
    <Hosts>
        <Host Name="Mailbox"/>
    </Hosts>
    <Requirements>
        <Sets>
            <Set Name="Mailbox" MinVersion="1.12"/>
        </Sets>
    </Requirements>
    <FormSettings>
        <Form xsi:type="ItemRead">
            <DesktopSettings>
                <SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/>
                <RequestedHeight>250</RequestedHeight>
            </DesktopSettings>
        </Form>
    </FormSettings>
    <Permissions>ReadWriteItem</Permissions>
    <Rule xsi:type="RuleCollection" Mode="Or">
        <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
    </Rule>
    <DisableEntityHighlighting>false</DisableEntityHighlighting>
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides"
                      xsi:type="VersionOverridesV1_0">
        <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1"
                          xsi:type="VersionOverridesV1_1">
            <Requirements>
                <bt:Sets DefaultMinVersion="1.12">
                    <bt:Set Name="Mailbox"/>
                </bt:Sets>
            </Requirements>
            <Hosts>
                <Host xsi:type="MailHost">
                    <!-- Event-based activation happens in a lightweight runtime.-->
                    <Runtimes>
                        <!-- HTML file including reference to or inline JavaScript event handlers.
                             This is used by Outlook on the web and Outlook on the new Mac UI. -->
                        <Runtime resid="WebViewRuntime.Url">
                            <!-- JavaScript file containing event handlers. This is used by Outlook on Windows. -->
                            <Override type="javascript" resid="JSRuntime.Url"/>
                        </Runtime>
                    </Runtimes>
                    <DesktopFormFactor>
                        <FunctionFile resid="Commands.Url"/>
                        <ExtensionPoint xsi:type="MessageReadCommandSurface">
                            <OfficeTab id="TabDefault">
                                <Group id="msgReadGroup">
                                    <Label resid="Group.Label"/>
                                    <Control xsi:type="Menu" id="Menu">
                                        <Label resid="Group.Label"/>
                                        <Supertip>
                                            <Title resid="Group.Label"/>
                                            <Description resid="TaskpaneButton.Tooltip"/>
                                        </Supertip>
                                        <Icon>
                                            <bt:Image size="16" resid="SalesflareIcon.16x16"/>
                                            <bt:Image size="32" resid="SalesflareIcon.32x32"/>
                                            <bt:Image size="80" resid="SalesflareIcon.80x80"/>
                                        </Icon>
                                        <Items>
                                            <Item id="Menu.Item1">
                                                <Label resid="TaskpaneButton.Label"/>
                                                <Supertip>
                                                    <Title resid="TaskpaneButton.Label"/>
                                                    <Description resid="TaskpaneButton.Tooltip"/>
                                                </Supertip>
                                                <Icon>
                                                    <bt:Image size="16" resid="SalesflareIcon.16x16"/>
                                                    <bt:Image size="32" resid="SalesflareIcon.32x32"/>
                                                    <bt:Image size="80" resid="SalesflareIcon.80x80"/>
                                                </Icon>
                                                <Action xsi:type="ShowTaskpane">
                                                    <SourceLocation resid="Taskpane.Url"/>
                                                    <!-- Enables your add-in to activate without the Reading Pane enabled or a message selected. -->
                                                    <SupportsPinning>true</SupportsPinning>
                                                </Action>
                                            </Item>
                                            <Item id="Menu.Item2">
                                                <Label resid="AddToAccountButton.Label"/>
                                                <Supertip>
                                                    <Title resid="AddToAccountButton.Label"/>
                                                    <Description resid="AddToAccountButton.Tooltip"/>
                                                </Supertip>
                                                <Icon>
                                                    <bt:Image size="16" resid="AddToAccount.Icon.16x16"/>
                                                    <bt:Image size="32" resid="AddToAccount.Icon.32x32"/>
                                                    <bt:Image size="80" resid="AddToAccount.Icon.80x80"/>
                                                </Icon>
                                                <Action xsi:type="ExecuteFunction">
                                                    <FunctionName>addEmailToAccount</FunctionName>
                                                </Action>
                                            </Item>
                                            <Item id="Menu.Item3">
                                                <Label resid="SettingsButton.Label"/>
                                                <Supertip>
                                                    <Title resid="SettingsButton.Label"/>
                                                    <Description resid="SettingsButton.Tooltip"/>
                                                </Supertip>
                                                <Icon>
                                                    <bt:Image size="16" resid="Settings.Icon.16x16"/>
                                                    <bt:Image size="32" resid="Settings.Icon.32x32"/>
                                                    <bt:Image size="80" resid="Settings.Icon.80x80"/>
                                                </Icon>
                                                <Action xsi:type="ExecuteFunction">
                                                    <FunctionName>openSettingsDialog</FunctionName>
                                                </Action>
                                            </Item>
                                        </Items>
                                    </Control>
                                </Group>
                            </OfficeTab>
                        </ExtensionPoint>

                        <!-- Enable launching the add-in on the included event. -->
                        <ExtensionPoint xsi:type="LaunchEvent">
                            <LaunchEvents>
                                <LaunchEvent Type="OnMessageSend" FunctionName="onMessageSendHandler" SendMode="SoftBlock" />
                            </LaunchEvents>
                            <!-- Identify the runtime to be used (also referenced by the Runtime element). -->
                            <SourceLocation resid="WebViewRuntime.Url"/>
                        </ExtensionPoint>

                    </DesktopFormFactor>
                </Host>
            </Hosts>
            <Resources>
                <bt:Images>
                    <bt:Image id="SalesflareIcon.16x16" DefaultValue="https://localhost:3000/assets/sf-icon.png"/>
                    <bt:Image id="SalesflareIcon.32x32" DefaultValue="https://localhost:3000/assets/sf-icon.png"/>
                    <bt:Image id="SalesflareIcon.80x80" DefaultValue="https://localhost:3000/assets/sf-icon.png"/>
                    <bt:Image id="AddToAccount.Icon.16x16"
                              DefaultValue="https://localhost:3000/assets/add-to-account-icon.png"/>
                    <bt:Image id="AddToAccount.Icon.32x32"
                              DefaultValue="https://localhost:3000/assets/add-to-account-icon.png"/>
                    <bt:Image id="AddToAccount.Icon.80x80"
                              DefaultValue="https://localhost:3000/assets/add-to-account-icon.png"/>
                    <bt:Image id="Settings.Icon.16x16" DefaultValue="https://localhost:3000/assets/settings-icon.png"/>
                    <bt:Image id="Settings.Icon.32x32" DefaultValue="https://localhost:3000/assets/settings-icon.png"/>
                    <bt:Image id="Settings.Icon.80x80" DefaultValue="https://localhost:3000/assets/settings-icon.png"/>
                </bt:Images>
                <bt:Urls>
                    <bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/>
                    <bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
                    <bt:Url id="WebViewRuntime.Url" DefaultValue="https://localhost:3000/commands.html"/>
                    <bt:Url id="JSRuntime.Url" DefaultValue="https://localhost:3000/launchevent.js"/>
                </bt:Urls>
                <bt:ShortStrings>
                    <bt:String id="Group.Label" DefaultValue="Salesflare 5.0"/>
                    <bt:String id="TaskpaneButton.Label" DefaultValue="Show sidebar"/>
                    <bt:String id="AddToAccountButton.Label" DefaultValue="Add to account"/>
                    <bt:String id="SettingsButton.Label" DefaultValue="Settings"/>
                </bt:ShortStrings>
                <bt:LongStrings>
                    <bt:String id="TaskpaneButton.Tooltip"
                               DefaultValue="Opens a pane displaying all available properties."/>
                    <bt:String id="AddToAccountButton.Tooltip" DefaultValue="Adds an opened email to an account."/>
                    <bt:String id="SettingsButton.Tooltip" DefaultValue="Opens the settings."/>
                </bt:LongStrings>
            </Resources>
        </VersionOverrides>
    </VersionOverrides>
</OfficeApp>

These are the logs when I enable runtime logging:

13/10/2023 17:49:25 Medium  Web Add-In Runtime Logging Session Started          
13/10/2023 17:49:25 Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 9566c1b4-341c-4e21-944d-2eb892ecd61e, Location : Element Namespace "http://schemas.microsoft.com/office/mailappversionoverrides" : Element Name "VersionOverrides" : xsi:Type "VersionOverridesV1_0", Line=39, CharPosition=6      
13/10/2023 17:49:26 Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 9fd38622-d9b4-4401-b1b9-1ce14c5e435a, Location : Element Namespace "http://schemas.microsoft.com/office/mailappversionoverrides/1.1" : Element Name "LaunchEvent", Line=453, CharPosition=18       
13/10/2023 17:49:26 Monitorable Manifest    Skipped unrecognized XML element for add-in ID : f60b8ac7-c3e3-4e42-8dad-e4e1fea59ff7, Location : Element Namespace "http://schemas.microsoft.com/office/appforoffice/1.0" : Element Name "TabletSettings", Line=64, CharPosition=6     
13/10/2023 17:49:26 Monitorable Manifest    Skipped unrecognized XML element for add-in ID : f60b8ac7-c3e3-4e42-8dad-e4e1fea59ff7, Location : Element Namespace "http://schemas.microsoft.com/office/appforoffice/1.0" : Element Name "PhoneSettings", Line=68, CharPosition=6      
13/10/2023 17:49:26 Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 7a774f0c-7a6f-11e0-85ad-07fb4824019b, Location : Element Namespace "http://schemas.microsoft.com/office/appforoffice/1.1" : Element Name "TabletSettings", Line=69, CharPosition=12        
13/10/2023 17:49:26 Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 7a774f0c-7a6f-11e0-85ad-07fb4824019b, Location : Element Namespace "http://schemas.microsoft.com/office/appforoffice/1.1" : Element Name "PhoneSettings", Line=73, CharPosition=12     
13/10/2023 17:49:26 Monitorable Manifest    Skipped unrecognized XML element for add-in ID : a216ceed-7791-4635-a752-5a4ac0a5eb93, Location : Element Namespace "http://schemas.microsoft.com/office/appforoffice/1.1" : Element Name "TabletSettings", Line=68, CharPosition=8     
13/10/2023 17:49:26 Monitorable Manifest    Skipped unrecognized XML element for add-in ID : a216ceed-7791-4635-a752-5a4ac0a5eb93, Location : Element Namespace "http://schemas.microsoft.com/office/appforoffice/1.1" : Element Name "PhoneSettings", Line=71, CharPosition=8      
13/10/2023 17:49:26 Monitorable Manifest    Skipped unrecognized XML element for add-in ID : bc13b9d0-5ba2-446a-956b-c583bdc94d5e, Location : Element Namespace "http://schemas.microsoft.com/office/appforoffice/1.1" : Element Name "TabletSettings", Line=71, CharPosition=12        
13/10/2023 17:49:26 Monitorable Manifest    Skipped unrecognized XML element for add-in ID : bc13b9d0-5ba2-446a-956b-c583bdc94d5e, Location : Element Namespace "http://schemas.microsoft.com/office/appforoffice/1.1" : Element Name "PhoneSettings", Line=75, CharPosition=12     
13/10/2023 17:49:26 Unexpected  Resource    The resource you are trying to use does not exist.      
13/10/2023 17:49:26 Unexpected  Resource    The resource you are trying to use does not exist.      
13/10/2023 17:49:26 Unexpected  SourceMap   Debugging is enabled, but source map file is unavailable. SolutionId=9566c1b4-341c-4e21-944d-2eb892ecd61e , AppVersion=1.0.0.0      

Not sure what Resource The resource you are trying to use does not exist. is refering to, I checked all my URLs under <Resources></Resources> and they all seem available.

Any thoughts?

kdeclerck commented 10 months ago

I'm still facing this issue. Any pointers in the right direction? 🙏

pepso commented 10 months ago

I'm hitting my head to the same or similar problem after completing these two tutorials:

  1. https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/outlook-quickstart?tabs=yeomangenerator
  2. https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/autolaunch?tabs=xmlmanifest

When I create an email, or an appointment through Web Outlook, the subject gets set (as per the tutorials) + all other stuff works.

This is not the case on Outlook Desktop on Windows 11 (Outlook: 2310 Build 16.0.16924.20054). Event's don't fire... Since adding the 2nd tutorial even the ribbon buttons "Perform an action" and "Show Taskpane" slowed down a lot (~30-60 seconds). Both, the "Performed action" or "Show Taskpane" says "loading..." the 30-60 seconds before showing up.

All the URLs in the manifest are available (from the :3000 webserver), Wef's bundle.js seems to include launchevent.js contents, and the manifest in Wef is the latest one.

This is only thing I get in the log files: 01/11/2023 13:58:24 Unexpected Resource The resource you are trying to use does not exist.
01/11/2023 13:58:24 Unexpected Resource The resource you are trying to use does not exist.
01/11/2023 13:58:24 Unexpected SourceMap Debugging is enabled, but source map file is unavailable. SolutionId=[the id], AppVersion=1.0.0.0

EventViewer for Outlook has an error (@ the same time as above log rows): We're sorry, we couldn't access [Add in name]. Make sure you have a network connection. If the problem continues, please try again later. Add-In ID : [the id]

bchenhs commented 9 months ago

We also ran into the same issue here. We followed the tutorials but could only get the event-based activation to work on OWA and Outlook for Mac.

Any updates, @exextoc?

kinkoazc commented 8 months ago

@kdeclerck @pepso @bchenhs Are you maybe missing the well-known URI? https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/use-sso-in-event-based-activation#list-allowed-add-ins-in-a-well-known-uri

pepso commented 4 months ago

@kinkoazc my understanding for the well-known URI is to enable SSO for the add in and this is not a pre-requisite to fire events / code for the events. I did try this on the localhost as specified by the article to no avail.

What did happen was that 2 rows of the logs did disappear, but the events are still not firing.

As it stands, the launchevents fire only on Outlook new on desktop and Outlook OWA.

kinkoazc commented 4 months ago

@pepso It could be something event-handler related. Try rewriting/simplifying(& re-adding) them to a format that IE11 engine can process.

pepso commented 4 months ago

@kinkoazc just my thinking as well. I don't know how to make it simpler than what I have thus far though so it gives some input to the desktop Outlook versions (I cannot attach debugger to the old outlook as there's no events being executed):

On Outlook new and OWA I get the code to do what I expect: image

Same code and manifest for Desktop old version: image

What I can gather the code in commands.js is either not available for execution, does not get executed, or is unable to associate the events for "action" events. Because onAppointmentSend tries to do something this gets just more confusing to me.

bundle.js is all fine loaded into the extension Wef folder with the corresponding manifest so definitely available from the :3000 server.

Event Viewer has a following error message from the second I click "Send" to an event:

We're sorry, we couldn't access DEV Events. Make sure you have a network connection. If the problem continues, please try again later. Add-In ID : de442f6d-5c8d-4eec-b31f-56cd23398561 Error code : 2147500037 Outlook version : 16.0.17425.20176 OS version : PRODUCT_PROFESSIONAL/x64/10.0.22631.3447

It's like some black magic Outlook old cannot access bundle.js file from the temp folder to execute the code which it itself downloads into the temp folder.

Here's the code/manifest I use and my Outlook is build 2403 from April 9th.

commands.js:

Office.onReady();

function action(event) {
  console.log("action", event)
  const type = Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage;
  const id = "random-message-id";
  const message = { type, message: "event fired", icon: "Icon.48x48", persistent: false };
  Office.context.mailbox.item.notificationMessages.replaceAsync(id, message);
  return event.completed();
}

function sendAction(event) {
  console.log("sendAction", event)
  const response = {allowEvent:false, errorMessage:"sendAction fired"};
  return event.completed(response);
}

Office.actions.associate("onAppointmentSend", sendAction);
Office.actions.associate("onNewAppointmentOrganizer", action);
Office.actions.associate("onAppointmentAttachmentsChanged", action);
Office.actions.associate("onAppointmentAttendeesChanged", action);
Office.actions.associate("onAppointmentTimeChanged", action);
Office.actions.associate("onAppointmentRecurrenceChanged", action);
Office.actions.associate("onAppointmentOrganizer", action);

And my manifest.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
  <Id>de442f6d-5c8d-4eec-b31f-56cd23398561</Id>
  <Version>1.0.1.0</Version>
  <ProviderName>DEV</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="DEV Events"/>
  <Description DefaultValue="DEV Events Firing."/>
  <IconUrl DefaultValue="https://localhost:3000/assets/icon-48.png"/>
  <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-128.png"/>
  <SupportUrl DefaultValue="https://help.support.com"/>
  <AppDomains>
    <AppDomain>https://localhost:3000</AppDomain>
  </AppDomains>
  <Hosts>
    <Host Name="Mailbox"/>
  </Hosts>
  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.13"/>
    </Sets>
  </Requirements>
  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://localhost:3000/commands.html"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>
  <Permissions>ReadItem</Permissions>
  <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="ReadOrEdit" />
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
      <Requirements>
        <bt:Sets DefaultMinVersion="1.13">
          <bt:Set Name="Mailbox" />
        </bt:Sets>
      </Requirements>
      <Hosts>
        <Host xsi:type="MailHost">
          <!-- Event-based activation happens in a lightweight runtime.-->
          <Runtimes>
            <!-- HTML file including reference to or inline JavaScript event handlers.
                This is used by Outlook on the web and Outlook on the new Mac UI. -->
            <Runtime resid="WebViewRuntime.Url">
              <!-- JavaScript file containing event handlers. This is used by Outlook on Windows. -->
              <Override type="javascript" resid="JSRuntime.Url"/>
            </Runtime>
          </Runtimes>
          <DesktopFormFactor>
            <!-- Enable launching the add-in on the included events. -->
            <ExtensionPoint xsi:type="LaunchEvent">
              <LaunchEvents>
                <LaunchEvent Type="OnAppointmentSend" FunctionName="onAppointmentSend" SendMode="PromptUser" />
                <LaunchEvent Type="OnNewAppointmentOrganizer" FunctionName="onNewAppointmentOrganizer"/>
                <LaunchEvent Type="OnAppointmentAttachmentsChanged" FunctionName="onAppointmentAttachmentsChanged" />
                <LaunchEvent Type="OnAppointmentAttendeesChanged" FunctionName="onAppointmentAttendeesChanged" />
                <LaunchEvent Type="OnAppointmentTimeChanged" FunctionName="onAppointmentTimeChanged" />
                <LaunchEvent Type="OnAppointmentRecurrenceChanged" FunctionName="onAppointmentRecurrenceChanged" />
                <LaunchEvent Type="OnAppointmentOrganizer" FunctionName="onAppointmentOrganizer" />
              </LaunchEvents>
              <!-- Identifies the runtime to be used (also referenced by the Runtime element). -->
              <SourceLocation resid="WebViewRuntime.Url"/>
            </ExtensionPoint>
          </DesktopFormFactor>
        </Host>
      </Hosts>
      <Resources>
        <bt:Images>
          <bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/icon-16.png"/>
          <bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/icon-32.png"/>
          <bt:Image id="Icon.48x48" DefaultValue="https://localhost:3000/assets/icon-48.png"/>
          <bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="WebViewRuntime.Url" DefaultValue="https://localhost:3000/commands.html" />
          <bt:Url id="JSRuntime.Url" DefaultValue="https://localhost:3000/commands.js" />
        </bt:Urls>
      </Resources>
    </VersionOverrides>
  </VersionOverrides>
</OfficeApp>
pepso commented 4 months ago

Found out simplified scenario to test while going back to project generator level...

Creating a new sample project:

yo office       
? Choose a project type: Office Add-in Task Pane project
? Choose a script type: JavaScript
? What do you want to name your add-in? messageAddin
? Which Office client application would you like to support? Outlook
? Which manifest type would you like to use? XML manifest
npm start

And the extension works when selecting any email on the inbox just like expected.

Now when doing exactly the same, but repurposing the example to the calendar:

yo office
? Choose a project type: Office Add-in Task Pane project
? Choose a script type: JavaScript
? What do you want to name your add-in? calendarAddIn
? Which Office client application would you like to support? Outlook
? Which manifest type would you like to use? XML manifest

Going into manifest.xml and changing MessageReadCommandSurface to AppointmentOrganizerCommandSurface

npm start

Now, when I open an appointment from the calendar, there's a 60 second delay before the taskpane shows up (says just loading...).

There's also following log row in Office runtime logs: Unexpected Resource The resource you are trying to use does not exist.

.. I also attempted to use https://learn.microsoft.com/en-us/samples/officedev/pnp-officeaddins/outlook-add-in-check-item-categories/ this sample copy and running it has same 60 second delay when attempting to open the taskpane.

@exextoc, or anyone else able to help me to understand what I do wrong? This must be something super obvious like "you are not allowed to use AppointmentOrganizerCommandSurface in old version of the Outlook desktop for windows"?

1TheMuffinMan commented 1 month ago

I'm running into the same issue with Classic Outlook for Windows. The OnMessageSend event in particular is never triggered which results in the UI saying that the add-in is working on request and then it times out. I was able to get the VSCode debugging working with the bundle.js file. The OnMessageSend works fine in New Outlook for Windows and in the browser.

My events for Recipient Changed and On New Compose work every single time.

millerds commented 1 month ago

Try getting the launch event file from webpack without it injecting it's hot relaod code by doing this: Add this to the devServer section of webpack config: static: { directory: path.join(__dirname, "dist"), publicPath: "/public", }, And then update the manifest to point to "https://localhost:3000/public/launchevents.js" for the launch event file. This tells webpack to serve up the file unaltered. Hot reload still works on the other files.