hi,i create my own plugin,and it`s amost done.
1、i use api create my own function
Asc.plugin.callCommand(function () {
Api.AddCustomFunctionLibrary("DocumentTest", function () {
/**
* Function that returns the argument
* @customfunction
* @param {any} data Any data.
* @returns {any} second Second argument.
*/
Api.AddCustomFunction(function DOCUMENT_ATTACHMENT(data) {
return data;
});
});
})
yes, it`s working,
now i use Api.PasteHtml and Api.PasteText add DOCUMENT_ATTACHMENT function to cell like:
Asc.plugin.executeMethod('PasteHtml', ['=DOCUMENT_ATTACHMENT("A\nB")'])
Asc.plugin.executeMethod('PasteText', ['=DOCUMENT_ATTACHMENT("A\nB")'])
as you can see,my data is \n,mean i want this function return new line text,
but use PasteHtml,i get A B on cell
use PasteText i get =DOCUMENT_ATTACHMENT(“A on one cell,and next cell well insert B”)
please,how make it`s working