Search richtext and put in a textfield

I have a richtext called Body

I want to search Body for the string

department: ICT

After the search i want the department name (in this case ICT but it can be commercials too) placed in the textfield txtDepartment.

Is this possible?

Subject: more information

Call uidoc.FindString(“Afdeling: Faciliteiten”)Call uidoc.FindString(“Afdeling: Nieuws”)

Call uidoc.FindString(“Afdeling: Sport”)

Call uidoc.FindString(“Afdeling: Varia”)

Call uidoc.FindString(“Afdeling: Reclame”)

Call uidoc.Copy

I can use this but the problem is that it gives an alert when the string is not found.

Is there a way this alert will not be showed?

Subject: You don’t have to move the cursor around…

Use FieldGetText, which returns a string that you can search and extract data from using Instr and other string functions. We don’t want the cursor jumping around the screen just to locate data.

And for future reference, read about On Error statement.