Ich habe Probleme beim Versuch, ein Word-Add-in in Word 2016 MSO (16.0.7726.1049) 64-Bit für Windows zu öffnen.Angular 4 Office-Add-in, das lange Zeit beim Laden dauert
Das Problem ist, dass Word meistens gehängt wird oder es zu lange dauert, die App zu laden.
Ich verwende VS 20017, ASP.Net Core, Angular 4 und Webpack läuft auf der Anwendung.
Wenn ich das Beispiel "WordWebAddIn" aus Visual Studio-Standard-Projekt ausführen Das funktioniert gut für mich.
Bitte helfen Sie mir, dieses Problem zu beheben.
In main.ts I unten Code für Initialisierung mit:
///<reference path="../typings/globals/office-js/index.d.ts" />;
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
import { LocationStrategy, HashLocationStrategy } from '@angular/common';
import { enableProdMode } from '@angular/core';
enableProdMode();
if (window.hasOwnProperty('Office') && window.hasOwnProperty('Word'))
{
Office.initialize =() => {
console.log("Office init: bootstrapping Angular2");
platformBrowserDynamic().bootstrapModule(AppModule);
}
}
else
{
platformBrowserDynamic().bootstrapModule(AppModule);
}