try this..
VB Code:
Private Sub cmdGoogle_Click() Dim i As Long 'search text for blocked For i = 0 To lstBlocked.ListCount - 1 If InStr(cboSearch.Text, lstBlocked.List(i)) Then MsgBox "The Search Contains A Word That Is In The Block List." Exit Sub End If Next i 'make sure its not null If Len(cboSearch.Text) = 0 Then Exit Sub End If 'no blocked word found in search string, so lets continue wb1.Navigate ("http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=" & cboSearch) ' Search to see if exists in combobox For i = 0 To cboSearch.ListCount - 1 If UCase(cboSearch.Text) = UCase(cboSearch.List(i)) Then Exit Sub End If Next i 'doesnt exist so add it to top cboSearch.AddItem cboSearch.Text, 0 'save the new list Open App.Path & "\GoogleHistory.dat" For Output As #1 For i = 0 To cboSearch.ListCount - 1 Print #1, cboSearch.List(i) Next i Close #1 End Sub




Reply With Quote