I have a word document with html tags that I need converted to formatted text. For example I would like <strong>Hello</strong> to display as Hello instead.
Currently I'm using Open Office writer doc to generate word document and need to embed html text converted to formatted text which should also preserve coloring and formatting.
Open Office Writer Doc From Template Smart Service
Does anyone know a way to display code in Microsoft Word documents that
preserves coloring and formatting?
I have tried to include code as html to parse <b>, <i>, <a>, <li>, <div> and <p>, for example. But all the tags and formatted styles have ignored and resulted in a single normal text.
But as of now, I could only display it as normal text as Appian ignores all the html formatted code example <div>, <p>, <li>, <b> etc.
Discussion posts and replies are publicly visible
This is possible but rather complicated. First you should look up a primer on WordML, the special flavor of XML used in the background by Word to create formatted text (and basically everything else). It's not too unlike HTML in coding style, but the syntax is a little different and all the keywords are pretty much unique to WordML.
Second you'll need to build expression rules to parse your desired formatting into WordML, then arrange that text such that it can be inserted into your Word document. Anything you pass into the replacement field in the general Word from Template smart service, will be injected directly (and literally) into the word file, meaning you can inject XML as needed (you'd need to break out of the current text string, inject your XML, then open a new text string at the closing). Using this method you can create pretty much whatever you want in a Word file, even N-row N-column tables (though again it's super complex).
Thanks Mike SchmittI will explore more on WordML..
Also: what Appian version are you currently on?
Currently we are using Appian Version 20.3
Ok cool. If you have a 20.4 environment available to use, I have a demo app I can provide containing my prior attempts at writing a Word Doc Generator - it's been used in a few different places already, including on my old and longest-running project. Unfortunately I currently don't have any way of porting it to anything earlier than 20.4.
Thanks Mike Schmitt. I really appreciate your taking the time to write.
I could able to Generate Word doc and convert it to PDF with my sample template by passing required data through Appian Open Office writer doc method in Process Model.My only concern is to render the HTML text in a formatted way in Word doc. For example I would like <strong>Hello</strong> to display as Hello instead.
I tried to pass text as html code with <b>, <i>, <a>, <li>, <div> and <p> tags, for example. But all the tags and formatted styles have ignored and resulted in a single normal text.
It would be great if you have any solution or a demo app.
I'm unfamiliar with the capabilities and/or technical constraints in the Open Office Writer smart service. As far as I know though, OpenOffice documents also use a slightly more standardized version of WordML - you might try unzipping a generated OpenOffice document and seeing what's inside it.
Sure Mike Schmitt. Thanks for your time and comments.It really helpful and valuable information. Explored on many things.
Hi Mike Schmitt,It would be great if you could showcase your demo app. Also Please let me know if you already tested out any of the HTML formatted text in WordML.Please let me know your availability. We can schedule a meeting if that works fine for you.
Hi - I will try to make a new export today of the app after some of the code cleanup i want to do, if you have a way of using a 20.4 app. Keep in mind that this isn't so much a way to use "HTML formatted text", as it is a way to do the appropriate corresponding text formatting directly in the WordML language. It includes basic formatting like bold, italics, underline, and then also creating of tables. I've used it for generating word files for years now, so I can assure you that at least this much of it works.
Sure Mike Schmitt. That Helps!!!
Hi Mike Schimitt, I am having the same problem. Can I also get a demo app please? thank you!!