Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selecting text within a text field
#7
Hi Gintaras,
Sorry for delaying in thanking you!
Thanks for trying to help me with the RichEdit Text - no matter what I did, I kept on getting the same errors as I described previously.
Quote:An Unexpected Error Occurred:
Exception has been thrown by the target of the invocation.
Click Retry or Cancel to terminate the application
Quote:A fatal error occurred and the application will now terminate:
COM returned an unexpected error code: Details are RPC_E_CANTCALLOUT_ININPUTSYNCCALL

I think I know what the problem is: this text has fields that you can tab to mixed in with it - for the different parts of a medical report - i.e. HISTORY, COMPARISON, FINDINGS, IMPRESSION.

I believe this is generating the errors. So I have decided to go with the Copy All text, ReplaceRx, Paste string back in approach. It works!!


Code:
Copy      Help
act win("Sample App" "WindowsForms10.Window.8.app.0.378734a");err ret


int reportcid=GetWinId(child("" "WindowsForms10.RichEdit20W.app.0.378734a" win("SampleApp" "WindowsForms10.Window.8.app.0.378734a") 0x5))
str initialtext.getwintext(child(reportcid "" "WindowsForms10.RichEdit20W.app.0.378734a" win("SampleApp" "WindowsForms10.Window.8.app.0.378734a") 0x5))

str InsertedText=initialtext

InsertedText.replacerx("(?i)(?<=SAMPLE SITE OF INSERTION:)\s" "Sample Inserted Text")

act child(reportcid "" "WindowsForms10.RichEdit20W.app.0.378734a" win("SampleApp" "WindowsForms10.Window.8.app.0.378734a") 0x5);err ret

'Ca;; selects all
0.1
'X;; deletes all

outp InsertedText;err ret


To undo - the user just presses Ctrl-Z twice (once for the paste, once for the previous delete)

Thanks!!

Stuart


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)