How to Insert image in Excel sheet from Taskpane app

tring will be inserted.

    An array of arrays ("matrix"): Tabular data without headers will be inserted. For example, to write data to three rows in two columns, you can pass an array like this: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. To write a single column of three rows, pass an array like this: [["R1C1"], ["R2C1"], ["R3C1"]]

    A TableData object: A table with headers will be inserted.

Additionally, the following application-specific actions apply when writing data to a selection.

For Word

    If there is no selection and the insertion point is at a valid location, the specified data is inserted at the insertion point as follows:

        If data is a string, the specified text is inserted.

        If data is an array of arrays ("matrix") or a TableData object, a new Word table is inserted.

        If data is HTML, the specified HTML is inserted.
        Important note Important

        If any of the HTML you insert is invalid, Word will not raise an error. Word will insert as much of the HTML as it can and will omit any invalid data.

        If data is Office Open XML, the specified the XML is inserted.

    If there is a selection, it will be replaced with the specified data following the same rules as above.

For Excel

    If a single cell is selected:

        If data is a string, the specified text is inserted as the value of the current cell.

        If data is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten.

        If data is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten.

    If multiple cells are selected and the shape does not match the shape of data, an error is returned.

    If multiple cells are selected and the shape of the selection exactly matches the shape of data, the values of the selected cells are updated based on the values in data.

In all other cases, an error is returned.
Example

The following example sets the selected text or cell to "Hello World!", and if that fails, displays the value of the error.message property.
JavaScript

function writeText() {
    Office.context.document.setSelectedDataAsync("Hello World!",
        function (asyncResult) {
   &

Back  [1] [2] [3] [4] Next

Copyright © 2007-2012 www.chuibin.com Chuibin Copyright