office365 - Getting HTML selection from document in a Word add-in -


i'm creating office word add-in needs fetch text , show in task pane. since preferred show text same formatting in host document, i'm using getselecteddataasync() function , specifying office.coerciontype.html coercion type. works in word online; unfortunately not in word 2013 , 2016 clients.

looking @ documentation (http://dev.office.com/reference/add-ins/shared/document.getselecteddataasync), says office.coerciontype.html supported word not explicitly mention word online. judging behaviour, seems documentation maybe faulty , should other way around.

but maybe i'm missing something. ideas on why it's not working or how can proceed working? prefer minimal processing after getting selection, why fetching in html seemed best solution. fetching plain text not seem take paragraphs account absolute minimum requirement of formatting.

the similar question i've found, apps office 365 - return selected text styling , formatted, related not answer question.

this proved problem not office.coerciontype.html being unavailable, rather returning different html in word clients , word online. made things break later in code while applying simple filters html in turn made function did not return anything.

like stated in question documentation not obvious coercion type working in both word clients , word online, can hereby confirm indeed work in both variants of word.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -