We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Read Char Selection in Aspose Words

Is it possible to read the selection of an opened Word document, and find the Run of the selected text?
Thx in advance!

Hi

Thanks for your request. If you would like to find some specific text in the document, you can use ReplaceEvaluator. Please see the following link for more information.

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.range.replace_overload_3.html

Please describe more specific what you would like to achieve and I will try to help you.

Best regards.

Sure.

The situation is, when a user selects certain text in a Word document opened inside my app (using OLE), and clicks in a button, that would call a Aspose Word function to get this selected text and extract it to do some operation.

I saw that with the Selection class in Aspose.Editor API (that is, if I chose to contain the document in my app using Aspose Editor instead of inside an OLE component), but I’m using Java, so the Editor is not an option.

Hi

Thank you for more information. Unfortunately, you cannot do that using Aspose.Words. There is no equivalent of Selection in Aspose.Words.

Using Aspose.Words you can only create or edit Word documents programmatically.

However, if you can get selected text from your application, you can find a corresponding text in the document using Replace method and perform some operations.

Best regards.