Retrieve Highlighted Value in a rich text box - InfoPath Dev
in

InfoPath Dev

Retrieve Highlighted Value in a rich text box

Last post 07-01-2010 05:36 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-30-2010 11:56 AM

    • sauny
    • Not Ranked
    • Joined on 06-30-2010
    • Posts 1

    Retrieve Highlighted Value in a rich text box

    Hi all, My apologies is this is way off the mark with respect to the group it should be posted in, but I have just started development with InfoPath and have come against a problem. What I basically want to do is create some sort of Control which acts like a richtextbox. However, my control needs to do a few things differently. When you highlight a section of text within the box, I want to be able to assign that a certain parameter. e.g. "The cow jumped over the moon", I would like to highlight the "cow" and right click and select "Animal" from a list of entities. That should then highlight "cow" in red and store the fact that the cow is an animal in the XML somewhere. My question is, is this possible? If so, how would I go about grabbing the currently highlighted text from the InfoPath control and then making just that selection red? I can for go the right click menu for the time being and write a custom task pane in C# with a button on to mark the entity. I hope that makes sense?!? Dave
  • 07-01-2010 05:36 PM In reply to

    Re: Retrieve Highlighted Value in a rich text box

    Hi Sauny,

    I think you want Word Smart Documents bound to XML schemas. Too bad Word lost the lawsuit against thast company in Texas and they had to dumbdown the feature, but take a look at Word - you should be able to do what you describe using a Word Smart Doc.

    In InfoPath, you can create structured forms. For a legal document (a contract), you could do a similar thing using dropdowns inserted between hardcoded text. Just type your text and insert a dropdown for the word you want to change. Dropdown is bound to the secondary data source. If you are trying to do something like translation, I recommend trying to find an off the shefl piece of software for that.

    Rich text controls cannot support the feature you want, but you could use the taskpane (rich client only) to provide a mechanism for replacing text in a rich text control with a list of pre-baked options. We did a form for a multi-speciality clinic that inserted medication names into a prescription area. Unfortunately, text in a rich text control cannot be bound to a separate schema (it exists as XHTML in the form).

    Hope these ideas help a little. Sorry I couldn't be more helpful.

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.