Until recently I didn't know that you could access the "Find-And-Replace" Common Dialog.
Here is a class that makes it easy to access. The class will work with either a standard TextBox or a RichTextBox.
Here is an example of how you might use the class.Code:Option Explicit 'declare with events so that we can override the default 'behavior of the class and/or handle ShowHelp Dim WithEvents FindDialog As clsFindandReplace Private Sub Form_Load() Set FindDialog = New clsFindandReplace End Sub Private Sub Command2_Click() 'show the Find and Replace dialog box 'pass the handle of our RichTextBox to 'the class FindDialog.ShowReplace RTB.hwnd End Sub




Reply With Quote