office-js

Can not insert text in bookmark in word document using office.js for office add-in development

♀尐吖头ヾ 提交于 2019-12-24 05:58:39
问题 I am developing an add-in for word.The main task is to populate the bookmarks in a document with data from the database.In office.js all i have found that a bookmark can be accessed as a range object and i am using "rangeObject.insertText(text, insertLocation)" method for inserting data into a bookmark.But the problem is 2nd parameter insertLocation value can be 'Replace', 'Start', 'End', 'Before' or 'After'.Which basically appends the data before or after the bookmark.like this - image 1

itemId is changing after mail sent in outlook mail

ぃ、小莉子 提交于 2019-12-24 01:53:56
问题 I am getting itemId of a mail item after saveAsync in compose mode. Once mail item is sent, item Id coming in Office.context.mailbox.item.itemId is different than what is given in compose mode. Code used for getting itemId in compose mode: var itemId = Office.context.mailbox.item.itemId; if (itemId === null || itemId == undefined) { Office.context.mailbox.item.saveAsync(function (result) { itemId = result.value; }); } After the email is sent, I verified email's itemId from sent box using:

MicrosoftAjax.js is not loaded successfully inside Office application

蓝咒 提交于 2019-12-24 00:53:55
问题 I was using the CDN release of office-js , but had to change to a local version. After this change, it seems Office.initialize is not being run, which means the add-in doesn't work correctly. On the console, I see the following error: SCRIPT5022: MicrosoftAjax.js is not loaded successfully. office.js (18,26767) The only references to MicrosoftAjax.js that I can find are ASP.NET related, but my project is Typescript/React. Here's how office.js is being loaded in the html: <!doctype html> <html

Excel office-js: Merge 2 or more cells

巧了我就是萌 提交于 2019-12-24 00:45:15
问题 I need to merge 2 cells and have a value in the merged cell. My (failed) attempts: #1 Excel.run(function (context) { const newSheet = context.workbook.worksheets.add("New sheet 1"); newSheet.activate(); const values = [ ["Row 1", "", "Row 1"], ["Row 2", "Row 2", "Row 2"] ]; newSheet.getRange("A1").values = values; newSheet.getRange("A1:B1").merge = true; }); #2 Excel.run(function (context) { const newSheet = context.workbook.worksheets.add("New sheet 1"); newSheet.activate(); const values = [

context.application is undefined when using WordApi 1.3

醉酒当歌 提交于 2019-12-23 23:16:20
问题 With WordApi 1.3 it should be possible to use the new createDocument method to create new documents from within the web addIns. However, when using the example snippet below found in the documentation, context.application is undefined . Word.run(function (context) { // lets hold a valid base64 docx on this variable... var myStartingDocAsBase64 = "some valid base64 encoded docx"; var myNewDoc = context.application.createDocument(myStartingDocAsBase64); // note that the parameter is optional, a

Read parameters from Outlook 365 Add-In manifest

混江龙づ霸主 提交于 2019-12-23 23:07:56
问题 Is it possible to get the parameters from the Outlook 365 add-in manifest programmatically (like version number or maybe resources)? I've searched all over the internet, but haven't found any way to do it yet :( Some background: I need some information to be available at run-time from the manifest settings (the customers are expected to install the add-in via manifest and it is to be tailored for each customer with some special data). Thanks in advance! 回答1: The manifest file is only consumed

Office Dialog API send message to child dialog

旧时模样 提交于 2019-12-23 19:12:04
问题 We would like to use the Dialog API for some extra operations which are better suited to a larger work area. We already have the ability via the API to message the parent from the dialog ( Office.context.ui.messageParent ), however we would also like the ability to directly message the dialog, like a sendMessage function, for example: var dialog; Office.context.ui.displayDialogAsync('https://myDomain/myDialog.html', function (asyncResult) { if (asyncResult.status === "failed") {

How to debug office add-in for mac?

南笙酒味 提交于 2019-12-23 16:28:26
问题 I am developing a MS office add-in for Word. The test version is working fine on Word for Windows, but fails on Office for Mac. On Office for Mac, the add-in loads as it is supposed to, but whenever I try to click a button that executes a JS script that calls on a php web service that communicates with a MySQL database, nothing happens. I don't get any error messages, so I am looking for advice on how to debug the add-in on a mac. What tools can I use? For background, I have tried The Vorlon

Office.js content add-in insertion behavior

回眸只為那壹抹淺笑 提交于 2019-12-23 16:26:28
问题 When I installed an Office.js content add-in in Excel/PowerPoint before 4 October 2017, it automatically added an "insert button" to the Insert tab on the ribbon. If I pressed this button, the content add-in itself is inserted to the current document. However on 4 October 2017 this behavior suddenly changed and when I now install a content add-in, the "Add" button on the install screen immediately inserts the content add-in itself into the document, without creating its own button on the

Is it possible to copy excel formula using an office add-in?

☆樱花仙子☆ 提交于 2019-12-23 12:49:19
问题 I have managed to create a fully functioning task pane add-in for Excel 2013 using Visual Studio Pro 2013 and I have a bunch of test functions that all work nicely, like adding in data, creating bindings, creating tables etc. Now I want to do something that is very simple in Excel, which is add in a new column, then copy the column to the left of it into the new column. In excel this would copy all of the formula and any cell formulas references that are relational would transpose nicely to