How apply current style when inserting text?

Integration questions/issues
Post Reply
mmeyer
Posts: 9
Joined: Fri Feb 23, 2018 8:21 am

How apply current style when inserting text?

Post by mmeyer » Mon Apr 16, 2018 3:22 pm

I am using the following command to insert text from a plugin:

Code: Select all

window.Asc.plugin.executeMethod("PasteHtml", ["test"]);
Current behaviour:
The inserted text gets formatted with the style that is selected in the top right section of the editor (Normal, Heading 1, Heading 2, ...)

Needed behaviour:
I need the inserted text to be formatted with whatever style the user selected in the editor (e.g. style "Heading 1" but with a red font and bold)
Inserting the text from the plugin should behave exactly as if the user just typed the text in to the editor directly.

Is this possible? (With PasteHtml or some alternative solution)

Regards,
M. Meyer

Maxim
Posts: 1751
Joined: Tue Oct 11, 2016 2:34 pm

Re: How apply current style when inserting text?

Post by Maxim » Thu Apr 19, 2018 11:44 am

Hello!
Maybe this will help you

Post Reply