What are the objects, methods, and properties that we should use in our code?
Is the selected text accessible?
If my text filed called txtRichText can I do something like this:
If I understand correctly, you have a form in which you have a text field whose data type you've set to be rich text (XHTML) and you're wanting to put buttons on the form which let the user format the current selection in that text field in order to make the selection bold, italic and/or underlined.
Fortunately, Acrobat has a built-in text formatting toolbar which will do essentially what you're trying to achieve with your request. You can access it by selecting text in a rich text field (set the text field's Field Format to Rich Text and its Data Format to XHTML using the Object palette) and then pressing "Ctrl + E". This will open the text formatting toolbar with buttons for setting bold, italic, underline, strike-through, super script, font type, size, etc., and even paragraph alignment settings!
Many thanks for this information. I do appreciate it.
I can understand that this not possible (easily). However, it seems it'll be nice to have these properties exposed in an object called selection, for example. Maybe this will be one of the enhancement requests.