office-js

How do I fetch/read custom document properties using OfficeJs in a task pane app?

早过忘川 提交于 2019-12-20 03:16:51
问题 I have added custom document property "TemplateId" from server and in task pane app when the document opens I want to fetch this custom document property (see image) using OfficeJs. (using OfficeJs version 1.1) 回答1: There currently no OfficeJS APIs that allows you to read custom document properties. However, feel free to request one on the Office Extensibility Platform's UserVoice. Gabriel Royer - Developer on the Office Extensibility Team, MSFT 来源: https://stackoverflow.com/questions

Office Web App - Show task pane on load

狂风中的少年 提交于 2019-12-20 03:11:30
问题 How do I show a custom taskpane automatically when the add-in loads (i.e. without having to click a command that is tied to that URL)? 回答1: Jan 2018 update: Office has shipped a new feature which lets you configure your add-in to automatically open a task pane when the file loads if the add-in had been used there previously: https://docs.microsoft.com/en-us/office/dev/add-ins/design/automatically-open-a-task-pane-with-a-document. Original Answer: Commands cannot currently be used to launch a

In a outlook web add-in suddenly stops giving email address for sender/from object

爷,独闯天下 提交于 2019-12-20 02:44:08
问题 In my outlook web addin it suddenly stops giving email address of from & sender object, My code looks like: isSentItem() { return Office.context.mailbox.userProfile.emailAddress === Office.context.mailbox.item.sender.emailAddress; } I checked in console display name is coming correct but email address not populating: I am using cdn hosted officejs api: <script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script> Current version of officejs api

Office Add-in development: Insert image/picture in Word 2016

自闭症网瘾萝莉.ら 提交于 2019-12-19 23:23:22
问题 I would like to ask as to what is the best way to insert an image/picture to the document in JavaScript? I am weighing in between an online and offline images but don't know where to start. I've tried searching the API references but with the lack of code samples, I am not able to fully understand the "how". Any help will be greatly appreciated. Cheers! 回答1: We can insert images into document via OOXML, Html. And it is easy that using Html to insert online images. Here is an example for your

How to get username, email address, filename from task pane app

旧巷老猫 提交于 2019-12-19 19:52:47
问题 I cam trying to get the following information from the task pane app (Office Add-ins): User information ie. username, email address Filename of the current open document I'm currently developing an task pane add in for Word, Excel and PowerPoint, as well as an Outlook app. Please advise. 回答1: Single sign-on (SSO) was released in developer preview last week. As part of the system, your add-in gets a token from the Office host application that contains a "preferred_username" property. The value

Submit add-ins with custom functions (update?)

只愿长相守 提交于 2019-12-19 17:41:48
问题 I asked a question regarding submitting add-ins with custom functions 6 months ago. The conclusion at the moment was an add-in that uses custom functions cannot currently be published to the Office Store or via Office 365 centralized deployment. But I realize that the document has changed, now it is Known issues ... ... Deployment via the Office 365 Admin Portal and AppSource are not yet enabled. Moreover, I found the new functions button in Script Lab. Users could register a function like

Office-js addin with Excel and Edge Webview - how to delete cache?

ε祈祈猫儿з 提交于 2019-12-19 11:44:33
问题 We are developing an office-js javascript addin for Excel. We are testing the addin with sideloading in Excel on Windows. After updating Windows and Excel to new versions, the webview in Office/Excel has changed from IE to Edge. Now we need to delete the Edge browser cache in order to see the changes in the updated web service. To completely reload a sideloaded office-addin, it was sufficient to delete the local storage and IE browser cache. After updating to the Edge webview, we do not

Drag and Drop between Outlook and Add-in Pane

懵懂的女人 提交于 2019-12-19 11:34:54
问题 Is it possible to drag an attachment or e-mail to an Outlook Web-Addin. The add-in is available to either Outlook 365 (Web) or the main client My assumption is no - as it is a sandboxed boundary, but I have heard about people running applications in the system tray to intercept the mouse drag event? Is this viable? are there any security risks with this approach? Thank you Rich 回答1: System tray interception is not a viable solution, not only because of security concerns, but because of

Document not in sync after replace text

懵懂的女人 提交于 2019-12-19 10:52:43
问题 I'm trying to replace some text within a Word Online document but cannot get it to work. '{{test}} , [[test]] , {test}' results in '13 , 2 , 3' and not '1 , 2 , 3'. The first text seems to be processed twice. Any help much appreciated! Office.initialize = function(reason) { function ready() { var myTags = [ { "value": "1", "text": "{{test}}" }, { "value": "2", "text": "[[test]]" }, { "value": "3", "text": "{test}" } ]; async function FillTag(tag) { await Word.run(async function(context) { var

How do we add field code for Word using word javascript api

旧时模样 提交于 2019-12-19 10:18:24
问题 I want to add field code using word JavaScript API. I checked the API documentation but I found nothing regarding this. Is there a way to do it in this API? 回答1: There is no direct support in the API for adding fields, i.e. you will have to create Open XML containing the field. You can then insert this Open XML in your document (something a long the lines of the following untested snippet): // Run a batch operation against the Word object model. Word.run(function (context) { // Queue a