How to Insert image in Excel sheet from Taskpane app

How to Insert image in Excel sheet from Taskpane app

How i can insert image into Excel sheet from task pane app ?

and if possible how i can do the same for Outlook mail and Power-Point ?

I have found this article insert-image-in-document-from-taskpane and it works great for me when i'm using word, But when i used it in Excel i got this error "The enumeration isn't supported in the current host application"....Any help ?

I think it can not in Excel and PowerPoint unless HTML or OOXML support is available.
(I don't know about Outlook...)


 > data  Type: String, Array (array of arrays - "matrix"), TableData, HTML (Word only), or Office Open XML (Word only)

 

Office.context.document.setSelectedDataAsync(data [, options], callback);

Parameters

data

    Type: String, Array (array of arrays – "matrix"), TableData, HTML (Word only), or Office Open XML (Word only)

    The data to be set in the current selection. Required.
options

    Type: object

    Specifies the following optional parameters.

    coercionType

        Type: CoercionType

        Specifies how to coerce the data being set. Optional.
    asyncContext

        Type: array, boolean, null, number, object, string, or undefined

        A user-defined item of any type that is returned in the AsyncResult object without being altered. Optional.

callback

    Type: object

    A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. Optional.

Callback Value

When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter.

In the callback function passed to the setSelectedDataAsync method, you can use the properties of the AsyncResult object to return the following information.

Property
 

Use to...

AsyncResult.value
 

Always returns undefined because there is no object or data to retrieve.

AsyncResult.status
 

Determine the success or failure of the operation.

AsyncResult.error
 

Access an Error object that provides error information if the operation failed.

AsyncResult.asyncContext
 

Access your user-defined object or value, if you passed one as the asyncContext parameter.
Remarks

The value passed for data contains the data to write to the current selection. If the value is:

    A string: Plain text or anything that can be coerced to a s

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

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