Word 2008: Find then Select found text

I want to be able to search for a word or phrase in a Word document, then make it the selection, so that I can then do things with that selection such as insert a large chunk of text (find and replace only allows a replacement of up to 255 characters and I need to do more than this). If I could get the bit of code working below it would give me the tool to do the various things i need:

tell application "Microsoft Word"
	
	set myFind to find object of text object of active document
	clear formatting myFind
	clear formatting replacement of myFind
	
	tell active document
		
		execute find myFind find text "some text" wrap find find continue
		--Make the text that is found the current selection - THIS IS THE KEY LINE I'm having trouble with
--Then i can do something with the selection such as insert text.		
	end tell	
end tell

Many Thanks, HJ :slight_smile:

Thanks Jacques.

I also discovered that when you find some text in MS Word the found text should automatically become the selection, but because my script was a bit screwy it wasn’t making the found text the selection. Basically I needed to use “find object of selection” rather than “find object of text object of active document” for the found object to become the selection - this made the found object the selection and then I could easily perform a command on the selection :slight_smile: