Word add-in js getHtml() function not return all fully style - ms-word

I write word add-in in JS using this API: https://dev.office.com/reference/add-ins/word/word-add-ins-reference-overview
When I use function body.getHtml() I get almost everything , but some style is missing ,for example table of content is not with style, and when I use body.insertHtml() all style of table of content is not exist.
I success to get all style with body.getOoxml() function but it's very very long when I compare it to the html and this is bug problem for me .
What could I do?
Thank you

The issue here is that when you create a TOC what really happens in the doc is that we insert a special type of content control wrapping the TOC and we don't roundtrip it in docx-html conversions. In fact, if you save your TOCed document as HTML you will see that the style is lost in the resulting html. FWIW the links on the resulting HTML are functional.
That said, your only option as of now is to go OOXML.
thx,
Juan.

Related

How to get Delta from a row HTML string in flutter_quill?

Hallow! I need to insert HTML from server to flutter_quill editor, but how to do it? Maybe is it unable thing... Thanks for any answers!
I can make a new document from Delta or from JSON only
As far as I know flutter_quill don't support the html data types. I think it can provide data in delta, plain text & json formats only.
But you can use quill_html_editor library to use the html together with quill editor in flutter. The usage is almost like flutter_quill with more focus on html type content.
To set the html content to editor you just have to set the html string in the controller
await controller.setText(text);
Give it a try. May be it can fulfil your need.

Sharepoint Rest Api Search query, getting a field with rich text

I am trying to get a field with a rich text but it is striping all the html in the search query. Is there a way to get the html rather than the rich text?
https://{domain}.sharepoint.com/_api/search/query?querytext=%27claim%27&selectproperties=%27Title,Question,Answer%27
<d:Key>Answer</d:Key>
<d:Value xml:space="preserve"> See THIS Form​ . ​ </d:Value>
Answer is the Rich text field with a link in it, When I do a GET (_api/web/lists/getbytitle), it comes back with a link in that field.
Basically, I want to avoid having to call search then call a GET to replace the values.
I solved this by looking through the search properties and using the ID in the path to use a GET List
_api/web/lists/getbytitle('title')/items('1')
then replacing the column in search with the rich text with the one from the GET.
I only need 3 results or so, so this was not a problem for me.
It looks like in the search query, doesnt give back any html tags for the rich text column.

How can we get value from DOM Properties in JMeter?

I'm trying to record a scenario of SAP CRM.
But I have a problem due to that everytime I login SAP CRM generates a new hashed token and will be used in URL like below:
See Image 1 Here
I tried to check where is the information stored, and in firebug and I found it in DOM tab:
See Image 2 Here
Is there any way to get the value from this DOM Properties using Jmeter?
Usually the choices are in:
CSS/JQuery Extractor
XPath Extractor
Regular Expression Extractor
Choose the one, you're most familiar with. Usually it is Regular Expression Extractor, however parsing HTML with regular expressions is not a good idea, moreover you will be very sensitive to DOM changes (part of the element goes to next line, attributes change positions, etc.).
So I would recommend choosing between CSS and XPath, but choose them wisely. I.e. if the number of styles on the page is not too big - go for CSS, if there are a lot of styles but the DOM itself is not very complicated - choose XPath.

Office 2013 JavaScript API for Word - Content Control questions

is it possible to insert a content control into a Word document, then, get some sort of handle or context to the content control, and then insert HTML into it?
Essentially, the scenario that I am trying to create with the Office JavaScript API is to, upon the user's request, insert a rich text content control, and then populate it with HTML.
I am able to insert the content control from the JavaScript API using the approach suggested at http://social.msdn.microsoft.com/Forums/en-US/appsforoffice/thread/8c4809c7-743c-4388-aef0-bc6a6855c882. It requires a coercionType of ooxml. However, the content that I wish to populate with the ooxml is HTML based. So when I try to insert a content control with the following ooxml:
...Boiler ooxml to create content control...
<w:r><w:t><h1>Test header</h1><h2>Test subheader</h2><p>Test paragraph text</p></w:t></w:r>
The insert attempt fails. I'm assuming that's because you can't mix ooxml and html when inserting this into the document with a coercionType of ooxml.
Since this ooxml approach is the only way you can insert a content control, how can I then set the content control with HTML text? I have looked over the Document object help content at http://msdn.microsoft.com/en-us/library/fp142295.aspx, but I'm unsure how I can do this still, or if it's feasible.
Thanks
though I have not tried this with JS - it should be possible nontheless.
Try adding a altChunk Element, it can contain other open xml or html. I have used it a few times with success.
a few links on the issue:
http://blogs.msdn.com/b/brian_jones/archive/2008/12/08/the-easy-way-to-assemble-multiple-word-documents.aspx
http://blogs.msdn.com/b/ericwhite/archive/2008/10/27/how-to-use-altchunk-for-document-assembly.aspx
U should however try to use "strict"-xml - otherwise the above might not be possible.
I just found this example (sry it's german, but there should be an english version somewhere as well). In which coercionType is used like this:
Office.context.document.setSelectedDataAsync(
booksToRead,
{ coercionType: Office.CoercionType.Html },
function (result) {
// Access the results, if necessary.
});
This might do the trick as well.

Capybara, Cucumber, GWT problem asserting the text with inline styles

I was to check to see if a text with inline styles exist.
For example page.should have_content(text) works for raw text such as
"Time out",
however it does not work for the text
"Time out. Please Click here to retry".
Also I have been having trouble trying to locate an anchor with inline style as well ex:
<a>click <strong>here</strong>to retry</a>.
Thanks.
You are correct that have_content tests for text, not markup. You can do this though:
page.body.should include('... <a>...</a> ...')
Regarding your second question, I don't think it's possible to do page.has_link? with markup. You would have to construct your own XPath expression and then use page.should have_selector(:xpath, '...'). Or test for the raw HTML using page.body of course.