Questions tagged [javascript-api-for-office]

Tag referring to the Add-ins for Office Javascript APIs

Tag referring to the Add-ins for Office Javascript APIs (https://learn.microsoft.com/en-us/office/dev/add-ins/)

Also take a look at the tag.

79 questions
10
votes
1 answer

How to send back MS word cursor focus on current document after click in Task Pane

I have developed a Word Add-in using word java script API. When i click in Task pane to do some action the cursor focus removes from current document, i am not able to edit the document until click back on the document. Please advice me how i can…
5
votes
2 answers

Is there is a way to insert macro to worksheet from Excel Addin?

I searched documentation Office Excel API, but cannot find any mentions at all, how it can be implemented. The Problem: Luck of API functionality or some sort of bugs can be solved easily by VBA macros. But, for doing that, we have only two…
5
votes
2 answers

How to open new Word docx document in word Add-in

I have developed a word add-in using word javascript api. My Document .docx file is on server and i need to open that .docx document as a new word document on a button click in add-in. Please guide me how i can open new document in word…
5
votes
2 answers

Get message body using JavaScript API for Office

I'm working on a simple mail app and I need to get the body of a message. MSDN says, version 1.1 of JavaScript API for Office has body property for message object and it can be get like this: Office.context.mailbox.item.body; but the problem is…
Syed Ali Taqi
  • 4,898
  • 3
  • 34
  • 44
4
votes
1 answer

Office 2016 JavaScript API for Word, body.getHtml() and body.getOoxml() methods are not working

While trying to fetch Office 2016 Word document body using Office 2016 Word Add-In, java Script API methods body.getHtml() and body.getOoxml() are not working-; It is returning error "Debug info: {"errorLocation":"Body.getHtml"}" Reference document…
3
votes
1 answer

Office add-in: XMLHttpRequest cannot load XXX due to access control checks

I'm building an Outlook add-in with jQuery and the Office JS API. I have a local server going while developing, and I'm trying to submit a POST request to an endpoint on my site's main server. Every time I try to submit the request, I get the…
3
votes
0 answers

Nest tables with Office Javascript API in Word

I want to nest a table object inside other table cell using the javascript office api. I saw that the TableCell object doesn't have the method insertTable so i cannot call it though the cell. The table's method insertTable can receive only the…
sborpo
  • 928
  • 7
  • 15
3
votes
1 answer

Is it possible to get data of several selected mails inside an outlook web add-in app?

inside a Outlook COM Add-in (C#) I was able to retrieve all selected mails inside Outlook like this var selection = Globals.ThisAddIn.Application.ActiveExplorer().Selection; List outlookMailList = new…
3
votes
1 answer

Trigger calculation in JavaScript API for Excel

I am trying to use JavaScript API for Excel. Does anyone know how to trigger calculation for a cell, a range, a worksheet or a workbook? For instance, the following code selects a range, but how can we re-calculate the range? Excel.run(function…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
3
votes
1 answer

Programatically open a excel document using javascript office api

How to programatically open a document using javascript office api ? Is there a way to insert a document using javascript office api Or to get access to the document xml ? Something like this Excel.run(function (ctx) { var application =…
Nicu
  • 3,476
  • 4
  • 23
  • 43
2
votes
2 answers

How can I display console.log?

this topic is related to persons who developing excel add-ins using javascript api. https://learn.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-ranges#get-the-selected-range How can I display message via console.log(`The address of the…
2
votes
0 answers

How to create/enable bookmarks when converting word document to PDF using office js

I used getFileAsync() method to create pdf of the word document: Office.context.document.getFileAsync(Office.FileType.Pdf, function(result) { if (result.status == "succeeded") { var myFile = result.value; var sliceCount =…
2
votes
1 answer

Word JS api Access Denied (ContentControl.select, Body.getHtml)

I'm trying to select content control through js select() function - docs - but I'm always getting Access Denied error: Error: { "name": "OfficeExtension.Error", "code": "AccessDenied", "message": "AccessDenied", "traceMessages":…
kamilz
  • 168
  • 1
  • 12
2
votes
1 answer

How to write a formula from Javascript Api in Excel, that is independent from the user language?

What I do: var myTable = new Office.TableData(); ..... var y = []; y.push(...); ..... y.push('=SUM(Test[@[364]:[0]])/365'); y.push(...); ..... myTable.rows.push(y); and later binding.addRowsAsync(myTable.rows, function (addResult){....}); Now…
Mottor
  • 1,938
  • 3
  • 12
  • 29
2
votes
1 answer

How to Bind one handler to multiple ContentControls (with same title) in Word? Use Javascript API for Office

I'm developing with JavaScript API for Office, MS Word 2016, VisualStudio 2015. There are multiple Rich Text ContentContols with a same title in the document. I'm trying to bind these ContentControls to a handler so that I can get…
1
2 3 4 5 6