Hi all, got any idea of Search for a Phrase in a file? Perhaps a sentence?
Printable View
Hi all, got any idea of Search for a Phrase in a file? Perhaps a sentence?
VB Code:
Dim sText As String 'Open the file into a string Open "MyFile.txt" For Input As #1 sText = Input(LOF(1), 1) Close #1 'Search the string If InStr(1, sText, "My Sentence") <> 0 Then MsgBox "Sentence found"
Thank you very much bro. do You know how old I am?
How do you like Make your form focus?
I tried to use me.setfocus, doesn't even work, Also
me.show vbmodal, it does the job but it's so messy, I mean when I unload it it gets a lot of errors sometimes... Any other ways?
The following are different methods (which all work fine for me):
Show, ZOrder, SetFocus, SetActiveWindow (API), and SetForegroundWindow (API)
What routine is the code in?