Find Replace Dialog Box

Fellow Microstation Programmers,

 

When doing a find/replace Microstation pops-up an application modal dialog box but doesn't "kick-off" the IModalDialogEvents.  Does anyone know how to either:

1.  Prevent the dialog from activating?

or

2.  Close the dialog once it has been activated?

 

Code is as follows:

Private Sub mSubReplaceText(StrFindText As String, StrReplaceText As String)

'   Start a command

    CadInputQueue.SendCommand "MDL KEYIN FINDREPLACETEXT,CHNGTXT CHANGE DIALOGTEXT"

'   Send a keyin that can be a command string

    CadInputQueue.SendKeyin "FIND DIALOG SEARCHINCELLS True"

    CadInputQueue.SendKeyin "FIND DIALOG PAN True"

    CadInputQueue.SendKeyin "FIND DIALOG ZOOM True"

    CadInputQueue.SendKeyin "FIND DIALOG ZOOMLEVEL 100"

    CadInputQueue.SendKeyin "FIND DIALOG SEARCHSTRING " & StrFindText

    CadInputQueue.SendKeyin "FIND DIALOG REPLACESTRING " & StrReplaceText

   Dim modalHandler As New clsModalHandler

   AddModalDialogEventsHandler modalHandler  

    CadInputQueue.SendKeyin "CHANGE TEXT ALLFILTERED"

    CommandState.StartDefaultCommand

End Sub

 

Thanks in advance,

 

Christmas May