An open API service indexing awesome lists of open source software.

https://github.com/xsoulspace/officejs_dart

Unofficial Office.js (https://github.com/OfficeDev/office-js) wrapper for Flutter/Dart
https://github.com/xsoulspace/officejs_dart

dart dart-package exceljs officejs

Last synced: 3 months ago
JSON representation

Unofficial Office.js (https://github.com/OfficeDev/office-js) wrapper for Flutter/Dart

Awesome Lists containing this project

README

          






Unofficial Office.js (https://github.com/OfficeDev/office-js) wrapper for Flutter/Dart

Please note: the package is a Work In Progress and in highly risk of change.
Do not use it in production.

## Features

## Getting started with Excel

To start, add in the index.html "Initialize office" `then` section.
That's all you need to do)

```javascript
window.addEventListener("load", function (ev) {
// Download main.dart.js
_flutter.loader
.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
},
})
.then(function (engineInitializer) {
return engineInitializer.initializeEngine();
})
.then(function (appRunner) {
return appRunner.runApp();
})
/** Initialize office **/
.then(function () {
console.log("intializing office");
const officeEl = document.getElementById("office");
if (officeEl != null) return;

const scriptTag = document.createElement("script");
scriptTag.src =
"https://appsforoffice.microsoft.com/lib/1/hosted/office.js";
scriptTag.id = "office";
scriptTag.addEventListener("load", () => {
console.log("office loaded");
class OfficeHelpers {
officeOnReady = Office.onReady;
// may cause an error Excel is not defined
runExcel = Excel.run;
}
window["getOfficeHelpers"] = () => new OfficeHelpers();
console.log("helpers injected");
});
document.getElementsByTagName("head")[0].appendChild(scriptTag);
});
});
```

## Getting started with Outlook

To start, add in the index.html "Initialize office" `then` section.
That's all you need to do)

```javascript
window.addEventListener("load", function (ev) {
// Download main.dart.js
_flutter.loader
.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
},
})
.then(function (engineInitializer) {
return engineInitializer.initializeEngine();
})
.then(function (appRunner) {
return appRunner.runApp();
})
/** Initialize office **/
.then(function () {
console.log("intializing office");
const officeEl = document.getElementById("office");
if (officeEl != null) return;

const scriptTag = document.createElement("script");
scriptTag.src =
"https://appsforoffice.microsoft.com/lib/1/hosted/office.js";
scriptTag.id = "office";
scriptTag.addEventListener("load", () => {
console.log("office loaded");
class OfficeHelpers {
officeOnReady = Office.onReady;
context = Office.context;
}
window["getOfficeHelpers"] = () => new OfficeHelpers();
console.log("helpers injected");
});
document.getElementsByTagName("head")[0].appendChild(scriptTag);
});
});
```

## Donations / Sponsor

Please sponsor or donate to the creator on [Boosty](https://boosty.to/arenukvern) or [CloudTips](https://pay.cloudtips.ru/p/1629cd27).

Thank you for your support and have a great day! 🌄

## Getting Help

If you need help getting started or have questions, check out our [Discord Community](https://discord.gg/y54DpJwmAn).

## Usage

## Additional information