'Common Dialog DLL Calls
Private Declare Function FindText _
Lib "comdlg32.dll" _
Alias "FindTextA" (ByVal pFindreplace As FINDREPLACE) _
As Long
Private Declare Function ReplaceText _
Lib "comdlg32.dll" _
Alias "ReplaceTextA" (ByVal pFindreplace As FINDREPLACE) _
As Long
'''''''''''''
Private Structure FINDREPLACE
Dim lStructSize As Long
Dim hwndOwner As Long
Dim hInstance As Long
Dim flags As Long
Dim lpstrFindWhat As String
Dim lpstrReplaceWith As String
Dim wFindWhatLen As Integer
Dim wReplaceWithLen As Integer
Dim lCustData As Long
Dim lpfnHook As Long
Dim lpTemplateName As String
End Structure
'''''''''''''''''''
'Delcaration of the type structure
Dim frText As FINDREPLACE
''''''''''''''''''''''''''
Private Sub Form_Load()
'Set the Find/Replace Type properties
With frText
.lpstrReplaceWith = "Replace Text"
.lpstrFindWhat = "Find Text"
.wFindWhatLen = 9
.wReplaceWithLen = 12
.hInstance = App.hInstance
'''''''''''''ERROR:app is not declared
.hwndOwner = Me.hWnd
''''''''''''ERROR:hWnd is not a member of form
.lStructSize = LenB(frText)
''''''''''''''''''''ERROR:name 'LenB' is not declared
End With
End Sub
'''''''''''''''''''
Public Function m_find()
'Call the find text function
FindText(frText)
End Function
Public Function m_replace()
'Call the replace text function
ReplaceText(frText)
End Function