Dear Loungers
I have one macro that searches through a document for markers (<>), finds what is in between the markers, then displays the text between the markers as a message to an ‘end user’. I have called this macro PauseAndPrompt. This macro uses the Selection object to perform searches, deleting text, etc.
I have another 2 macros that are used in other parts of my system. The first of these is called SrchRep – it has a search string and replace string – both of which are passed into this procedure by the second macro. It then uses a ‘For Each’ loop to cycle through all ‘story ranges’ of a document and performs a search and replace of each relevant story range using the variables that are passed to this routine.
The third macro simply calls the SrchRep macro and passes it valid parameters. It calls the SrchRep macro twice.
All macros function perfectly well, except if I launch the first pause and prompt macro, immediately followed by the third macro (which in turn calls the srchrep macro), the first call to srchrep successfully completes, but the second call makes word crash.
Any assistance would be greatly appreciated. I have been tearing my hair out with this one. Text file with sample code is attached.
Thanks
Cathy