what to type to search all files?
Hi is there any easy way to search all files?
like
Code:
strExtension = "*.TXT"
'but instead i wanna search for all files like txt and exe and doc and so on...
'I thought of *.* as u do in cmd controle.
'But i didnt get it to work anyone knows how to Search For All Files.
'I allready got everything else so right now i can If said search for .txt or if said .Doc but not if i wanna search for every file can find...
Re: what to type to search all files?
Your question is not clear to me... :)
What code are you using...????
Is it VB6...???
Re: what to type to search all files?
my question is i got a search engine.... and in it i set extension to be "either .txt or other by using radiobuttons. What i want is to have a radiobutton so i can search for all extensions...
In CMD its called *.* then u search all extension (if i remember correctly)
i hope u understand
Re: what to type to search all files?
Re: what to type to search all files?
The above code allows wildcard searches... :)
Re: what to type to search all files?
code for the dir opening and such is:
Code:
strmessage = vbCr & "" & dirdialog.path
If right(fildialog.path, 1) = "7" then
strmessage = fildialog.path & fildialog.filename
Else
strmessage = fildialog.path & "/" & fildialog.filename
End If
Folderpath = strmessage
If option1.Value = true then
strExtension = "*.Txt"
'more of these'
end if ..... thats what i can sow u =) i want the
If option1.Value = true then
strExtension = "*.Txt"
to be like
If option1.Value = true then
strExtension = "*.*"
'searching all files'
but i dont know what i need to code to see all the files.
Re: what to type to search all files?
hmm i cant really get that into my coding... :ehh:
Re: what to type to search all files?
Quote:
Originally Posted by
goofan
code for the dir opening and such is:
Code:
strmessage = vbCr & "" & dirdialog.path
If right(fildialog.path, 1) = "7" then
strmessage = fildialog.path & fildialog.filename
Else
strmessage = fildialog.path & "/" & fildialog.filename
End If
Folderpath = strmessage
If option1.Value = true then
strExtension = "*.Txt"
'more of these'
end if ..... thats what i can sow u =) i want the
If option1.Value = true then
strExtension = "*.Txt"
to be like
If option1.Value = true then
strExtension = "*.*"
'searching all files'
but i dont know what i need to code to see all the files.
:confused::confused::confused::eek2:
Re: what to type to search all files?
that is where i select what kind of extension i need (at the end of the code ure quoting)
Re: what to type to search all files?
tell me what u need explained or if u dont understand something :bigyello:
Re: what to type to search all files?
Did you find any error while using *.* ?
Re: what to type to search all files?
well as i use *.*
it only opens .txt files! :?) and i dont know why no error nothing it just opens "only" .txt for some reason
Re: what to type to search all files?
ohh never mind i dont know why it aint showing the others but i know why it shows the txt...
.:.Ok my problem.:.
as i type in sand into my search box and tells it to search *.* it will look into every file it opens however it dont seem to open .doc for some reason and i know it sais sand in the .doc aswell as i typed it in just before.
Re: what to type to search all files?
Ok... So you are saying that you can't find the word you are searching, on MS Word files... ???
Do one thing... Open your MS Word document using Notepad (right click the file, then in Open With menu, choose Notepad )
Did you see the word.... ??? :)
MS Word files are different from text files....
Re: what to type to search all files?
There are many filetypes that use proprietary formats. This includes MS Word, WordPerfect, PDF Format and others. Even if you are able to open these documents in a binary mode and read the contents into a string doesn't mean you will find the Ascii text in that binary string. Frequently it will look like mumbo-jumbo.
The above post is correct. Open a .doc or .pdf file in Notepad and then search for the word. Chances are you will not find it.
To accurately search a proprietary format you'll need to convert it to text or use com object to open a file and search.
Re: what to type to search all files?
ok so i cant open it normally but how do i convert it? i need to be able to search throught all files!.
isnt there some kind of aplication or code that makes it possible to search all files with "any" extension.
-Thanks in advance
-Thomas
Re: what to type to search all files?
Will this help you..??? :)
Click Here
Re: what to type to search all files?
well i cant download anything as the work computer, the local server dont allow it. And then i dont really know (as i couldn´t download it) if the program where the application itself. What i ment when i said "is there any aplication or code..." was lika a API within Vb 6.0. Like an
addon sort of function.
Are u possible to show me a part of a code that solves this problem? (just so i can modifie it myself)
-Thanks in advance
-Thomas
Re: what to type to search all files?
Quote:
Originally Posted by
goofan
ok so i cant open it normally but how do i convert it? i need to be able to search throught all files!.
isnt there some kind of aplication or code that makes it possible to search all files with "any" extension.
There is code... but it can be very complex, and you need different code for almost every file type you want to work with.
For example, to read an Excel file (.xls or .xlsx etc) the easiest way by far is to use Automation, as shown in my Excel tutorial (link in my signature). Unfortunately this needs Excel to be installed - and it will only work for a small amount of file types.
To read other MS Office based files, see the relevant articles in our Office Development FAQs (at the top of the Office Development forum)