Private Sub Command0_Click() Dim inputfilename As String Dim outputfilename As String Dim collectword As String Dim collectword2 As String Dim inputcharacter As String * 1 Dim inputcharacter2 As String * 1 Dim responce As String * 1 Dim inputline As String Dim input_file_find As String Dim output_file_find As String Dim maxlinezise As Variant Dim result As Variant Dim i As Variant Dim firstletter As Integer Dim timein As Variant Dim timeout As Variant Dim counter As Long Dim home_directory As String timein = Time 'This are the EXTRA OPTIONS selected by the user home_directory = Me![Directory name] If IsNull(Me![Directory name]) Then MsgBox ("You must type a WORKING DIRECTORY NAME" + vbCrLf + "This is the application directory") Exit Sub End If If Right$(Me![Directory name], 1) <> "\" Then home_directory = home_directory & "\" End If On Error Resume Next Open home_directory & "temp.txt" For Output As #4 If Err <> 0 Then MsgBox ("You must type a WORKING DIRECTORY NAME" + vbCrLf + "This is the application directory") Exit Sub End If If Me![Cap States] = True Then Open home_directory & "state.txt" For Input As #5 Do While Not EOF(5) Line Input #5, inputline Print #4, inputline Loop Close #5 End If If Me![Cap Companies] = True Then Open home_directory & "company.txt" For Input As #5 Do While Not EOF(5) Line Input #5, inputline Print #4, inputline Loop Close #5 End If If Me![Cap Mix] = True Then Open home_directory & "mix.txt" For Input As #5 Do While Not EOF(5) Line Input #5, inputline Print #4, inputline Loop Close #5 End If If Me![Cap Country] = True Then Open home_directory & "country.txt" For Input As #5 Do While Not EOF(5) Line Input #5, inputline Print #4, inputline Loop Close #5 End If If Me![Check 8] = True Then Open home_directory & "title.txt" For Input As #5 Do While Not EOF(5) Line Input #5, inputline Print #4, inputline Loop Close #5 End If Close #4 'Check for INPUT formating, make sure file + directories are valid If IsNull(Me![Input file name]) Then MsgBox "You must type a INPUT PATH and FILE NAME" Exit Sub End If look_for_back_slash = Right$(Me![Input file name], 1) If look_for_back_slash = "\" Then MsgBox "The INPUT file name is invalid, it has a ""\"" at the end" Exit Sub End If If Me![Input file name] = "c:" Or Me![Input file name] = "c:\" Then MsgBox "You must type the INPUT file name" Exit Sub End If input_file_find = Dir$(Me![Input file name]) If Len(input_file_find) < 1 Then MsgBox "The INPUT file name was not found" Exit Sub End If 'Check for OUTPUT formating If IsNull(Me![Output file name]) Then MsgBox "You must type a OUTPUT FILE NAME (Path name is optional)" Exit Sub End If look_for_back_slash = Right$(Me![Output file name], 1) If look_for_back_slash = "\" Then MsgBox "The OUTPUT file name is invalid, it has a ""\"" in it" Exit Sub End If If Me![Output file name] = "c:" Or Me![Output file name] = "c:\" Then MsgBox "The OUTPUT file name is missing" + vbCrLf + "YOU MUST TYPE A FILE NAME" Exit Sub End If output_file_find = Dir(Me![Output file name]) If Len(output_file_find) > 0 Then responce = MsgBox("The OUTPUT file name exist" + vbCrLf + "DO YOU WANT TO CONTINUE", 1) If responce = 2 Then Exit Sub End If 'Get file names inputfilename = Me![Input file name] On Error Resume Next outputfilename = Me![Output file name] Open inputfilename For Input As #1 On Error Resume Next Open outputfilename For Output As #2 If Err <> 0 Then MsgBox "The OUTPUT file name is invalid" + cvcrlf + " This name is an exeption" Exit Sub End If Open home_directory & "temp.txt" For Input As #3 inputcharacter = "" inputcharacter2 = "" collectword = "" collectword2 = "" firstletter = 0 counter = 0 'Get data from input file Do While Not EOF(1) Line Input #1, inputline maxlinezise = Len(inputline) i = 1 Do While i <> (maxlinezise) + 2 inputcharacter = Mid$(inputline, i, 1) i = i + 1 If firstletter = 0 Then inputcharacter = UCase(inputcharacter) firstletter = 1 Else inputcharacter = LCase(inputcharacter) End If collectword = collectword & inputcharacter If inputcharacter = " " Then If collectword <> " " Then counter = counter + 1 'Check for some words formating If Left(collectword, 2) = "Mc" Then Mid$(collectword, 3, 1) = UCase(Mid$(collectword, 3, 1)) ElseIf Left(collectword, 3) = "Mac" Then Mid$(collectword, 4, 1) = UCase(Mid$(collectword, 4, 1)) ElseIf Left(collectword, 2) = "O'" Then Mid$(collectword, 3, 1) = UCase(Mid$(collectword, 3, 1)) ElseIf Left(collectword, 2) = "D'" Then Mid$(collectword, 3, 1) = UCase(Mid$(collectword, 3, 1)) Else 'compare input file(word)to those words in exeptions files Seek #3, 1 Do While Not EOF(3) Line Input #3, collectword2 collectword2 = collectword2 + " " result = StrComp(collectword, collectword2, 1) If result = "0" Then Print #2, collectword2; collectword = "" collectword2 = "" firstletter = 0 GoTo theend Else collectword2 = "" End If Loop End If End If Print #2, collectword; firstletter = 0 collectword = "" End If theend: Loop Print #2, Loop Close #1 Close #2 Close #3 timeout = Time 'Display this masage after finishing the entire job MsgBox "The End Started Running At: " & timein & " And Finished At: " & timeout & " Words Counted: " & counter End Sub Private Sub Directory_name_BeforeUpdate(Cancel As Integer) End Sub Private Sub Text14_BeforeUpdate(Cancel As Integer) End Sub