#1
|
|||
|
|||
VBA Find a string and move the cursor to it
I have a document which has a string such as <<INTERESTS>> in it. To humans this is a placeholder but to word it is just a string.
I want to find each occurrence of <<INTERESTS>>, MOVE the cursor there and then paste material from another doc. If I use the various methods of find and replace, the string changes but the cursor stays where it was last, and the inserts all occur there. I want to find "<<INTERESTS>>", move the cursor there and insert / paste THERE. I don't want to add bookmarks to each occurrence of <<INTERESTS>> unless no other method of positioning succeeds. Michael |
#2
|
||||
|
||||
Does what you want to paste in each location differ? If not, the simplest way of updating all instances is, in fact, to bookmark the first, then use cross-references to that bookmark for all the others. Otherwise, you need to tell us what determines the replacement content for each instance.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thanks, the pasting is no problem.
I want to find a text placemaker "<<INTERESTS>>" which may occur more than once in the main document. The emphasis is on find, because I want the cursor to move to the "found" <<INTERESTS>>, at which physical place, I will paste in the relevant document. I know that I can place bookmarks at each placeholder, but I want to use an existing document for preference. The various find examples I've tried, find the string, but do not move the cursor to it. Michael |
#4
|
||||
|
||||
There is no need to move the cursor when pasting programmatically, which is why I asked about what it is you're pasting - which you haven't answered.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A macro to find a symbol, delete it, and move the cursor to that location | JayBird24 | Word VBA | 1 | 08-19-2016 04:26 PM |
How to find all string within string. | PRA007 | Word VBA | 18 | 02-12-2016 08:11 PM |
move cursor | anand | Word VBA | 14 | 07-07-2015 05:57 AM |
Bad view when using Find and Find & Replace - Word places found string on top line | paulkaye | Word | 4 | 12-06-2011 11:05 PM |
can't move the cursor in Word | pieboy | Word | 2 | 02-13-2009 07:15 PM |