我正在关注这个网站来集成office js
像这样声明:
import * as Excel from '@microsoft/office-js/excel'
它显示编译时错误:
找不到模块“@microsoft/office-js/excel”
像这样声明:
declare var Excel: any
它显示运行时错误:
错误 ReferenceError:Excel 未定义
请建议如何申报。我需要像这样使用它:
Excel.run(session, (context){
...
});
Run Code Online (Sandbox Code Playgroud) office-addins typescript office-js angular office-js-helpers
我有以下两个组件(父组件和子组件)
\n.\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 Index.vue (Parent)\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 _GetShipment.vue (Child)\nRun Code Online (Sandbox Code Playgroud)\n在Index.vue我尝试使用 Office.js\ 的 getAsync 获取电子邮件正文的内容:
.\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 Index.vue (Parent)\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 _GetShipment.vue (Child)\nRun Code Online (Sandbox Code Playgroud)\n上面检查电子邮件正文内容以查看是否存在正则表达式匹配。如果存在,它将把匹配项添加到数组中shipments。
目前,如果仅找到一个匹配项,则该匹配项将在名为 的子组件中呈现_GetShipment:
<script>\nimport Shipment from \'./_GetShipment.vue\';\nimport { ref, defineComponent } from \'vue\';\n\n\nexport default defineComponent({\n setup() {\n const shipments = ref([]);\n\n Office.context.mailbox.item.body.getAsync(\n "text",\n function (result) {\n if (result.status === Office.AsyncResultStatus.Succeeded) {\n let matches = result.value.match(/S\\w{3}\\d{8,9}/ig);\n if(matches){\n shipments.value = matches;\n }\n }\n }\n );\n\n return {\n shipments,\n }\n },\n components: {\n Shipment,\n },\n})\n</script>\n\n<template>\n …Run Code Online (Sandbox Code Playgroud) 我使用Office-generator搭建了一个 Outlook 插件,当邮件以阅读模式打开时,它似乎会显示并运行,但在撰写新邮件时,它不会显示在插件部分中。我想显示插件以撰写模式显示,然后单击在窗格中打开插件。
以下是生成的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" xsi:type="MailApp" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0">
<Id>f1a2f021-ef67-4e8f-a08c-e24700c36c3d</Id>
<Version>1.0.0.0</Version>
<ProviderName>[Provider name]</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Test"/>
<Description DefaultValue="[Outlook Add-in description]"/>
<IconUrl DefaultValue="https://localhost:8443/images/icon-32.png"/>
<HighResolutionIconUrl DefaultValue="https://localhost:8443/images/hi-res-icon.png"/>
<Hosts>
<Host Name="Mailbox"/>
</Hosts>
<Requirements>
<Sets>
<Set Name="MailBox" MinVersion="1.1"/>
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="https://localhost:8443/appread/home/home.html"/>
<RequestedHeight>250</RequestedHeight>
</DesktopSettings>
</Form>
<Form xsi:type="ItemEdit">
<DesktopSettings>
<SourceLocation DefaultValue="https://localhost:8443/appcompose/home/home.html"/>
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteItem</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit" />
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit"/>
<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Read"/>
</Rule> …Run Code Online (Sandbox Code Playgroud) 我正在尝试修改 Excel 365 清单文件(添加 MS AppSource 现在需要的功能区命令)该文件被验证器(validate-office-addin)接受,但在 Excel 365 中旁加载时失败
Your add-in manifest is not valid.
Run Code Online (Sandbox Code Playgroud)
(以前的清单在这里工作)
Sideloading in local Excel 16 (German) not possible, because there is no option to upload an Addin manifest (there is just "My Add-Ins") which open a web page.
Opening in "File > Options > Add-Ins > XML package" fails for the current and the old Add-In maninfest because ther is a problem with a security certificate.
Is there a way to get a …
我是 Office 插件开发的新手,但在我们的组织中有一个项目。安装 package.json 文件中提到的所有依赖项后,当我尝试运行“npm run dev-server”时,出现以下错误:
\nc:\\git\\sample-project\\ui-addin>npm run dev-server\n\n> ui-addin@1.0.0 dev-server c:\\git\\sample-project\\ui-addin\n> webpack-dev-server --mode development\n\nYou already have trusted access to https://localhost.\nCertificate: C:\\Users\\Manish.Kumar\\.office-addin-dev-certs\\localhost.crt\nKey: C:\\Users\\Manish.Kumar\\.office-addin-dev-certs\\localhost.key\ni \xef\xbd\xa2wds\xef\xbd\xa3: Project is running at https://127.0.0.1:3000/\ni \xef\xbd\xa2wds\xef\xbd\xa3: webpack output is served from /\ni \xef\xbd\xa2wds\xef\xbd\xa3: Content not from webpack is served from c:\\git\\sample-project\\ui-addin\n(node:19272) UnhandledPromiseRejectionWarning: TypeError: The 'compilation' argument must be an instance of Compilation\nat Function.getCompilationHooks (c:\\git\\sample-project\\ui-addin\\node_modules\\custom-functions-metadata-plugin\\node_modules\\webpack\\lib\\NormalModule.js:207:10)\nat c:\\git\\sample-project\\ui-addin\\node_modules\\custom-functions-metadata-plugin\\lib\\customfunctionsplugin.js:41:36\nat SyncHook.eval [as call] (eval at create (c:\\git\\sample-project\\ui-addin\\node_modules\\webpack\\node_modules\\tapable\\lib\\HookCodeFactory.js:19:10), <anonymous>:7:1)\nat SyncHook.lazyCompileHook (c:\\git\\sample-project\\ui-addin\\node_modules\\webpack\\node_modules\\tapable\\lib\\Hook.js:154:20)\nat Compiler.newCompilation (c:\\git\\sample-project\\ui-addin\\node_modules\\webpack\\lib\\Compiler.js:631:26)\nat c:\\git\\sample-project\\ui-addin\\node_modules\\webpack\\lib\\Compiler.js:667:29\nat eval (eval at create (c:\\git\\sample-project\\ui-addin\\node_modules\\webpack\\node_modules\\tapable\\lib\\HookCodeFactory.js:33:10), <anonymous>:14:1)\nat …Run Code Online (Sandbox Code Playgroud) office-js ×4
angular ×1
excel ×1
javascript ×1
outlook ×1
typescript ×1
vue.js ×1
vuejs3 ×1
webpack ×1
webpack-4 ×1