Insert html snippet into C1Word created document

Posted by: gmckee on 10 July 2018, 12:42 pm EST

    • Post Options:
    • Link

    Posted 10 July 2018, 12:42 pm EST

    I have a database that I generate a Word document from (.docx). The C1Word library has the tools to create most of the document. However I have one field that contains some text that is formatted as HTML. I can’t figure out how to insert that text into my document and not show the html tags (, , , …… etc)

  • Posted 11 July 2018, 3:18 am EST

    Hi George!

    If you remove HTML tags from the text in word document, then later there is no way to know if this is HTML snippet.

    Can you please share your use case for this requirement? I might be able to suggest you something appropriate.

    Best regards,

    Meenakshi

  • Posted 24 July 2018, 5:04 pm EST

    The text field with html in it would be:

    INTESTINAL HEALTH OF ATLANTIC SALMON Salmo salar FED WITH MICROALGAE Nannochloropsis AND Tetraselmis

    I want to insert this into my document so that the tags are not shown but the formatting is:

    INTESTINAL HEALTH OF ATLANTIC SALMON Salmo salar FED WITH MICROALGAE Nannochloropsis AND Tetraselmis

  • Posted 25 July 2018, 12:50 am EST

    Hello,

    Apologies, but it is not possible with C1Word.

    However, you can try using C1Editor with which, you can load an xhtml/html document within an editor. You can learn more about the same from the below mentioned documentation link:

    http://help.grapecity.com/componentone/NetHelp/c1editorwinforms/webframe.html#loadinganxhtmldocume.html

    Note that you can further make changes to this document in the editor and save it back as html while the form closes. The code snippet for the same is:

        private void Form1_Load(object sender, EventArgs e)
            {
                c1Editor1.LoadXml("test.html"); 
    		//now, make some changes to the document in the C1Editor 
            }
    
            private void Form1_FormClosing(object sender, FormClosingEventArgs e)
            {
                c1Editor1.SaveXml("EditedFile.html");  
            }
    

    Best Regards,

    Esha

  • Posted 28 July 2018, 2:23 pm EST

    C1Editor does not help me create the desired output of a Word document. I already have an acceptable editor for the html snippets. I need to a create a printed document with 100s if not 1000s of the demonstrated snippets.

    You have only confirmed my conclusion that C1Word does not support my needed source for the desired output.

    George

  • Posted 30 July 2018, 2:02 am EST

    Hi George,

    Unfortunately, there’s no other way to do this.

    Feel free to post other queries on our forum. We’ll be happy to help.

    Regards,

    Esha

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels