Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to use Windows like Search for files containing Text in vb

Posted on 2002-04-09
6
Medium Priority
?
281 Views
Last Modified: 2010-05-02
How to use Windows like Search for files containing Text in vb
0
Comment
Question by:girishnayaks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 6930565
Hi Girishnayaks,

-open the VB Editor with ALT+F11
-then look for the thisworkbook icon on the left pane
-double click it
-paste the following code


Option Explicit
Public blnChanged As Boolean

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
  If WorksheetFunction.IsText(Target.Value) And blnChanged = False Then
    blnChanged = True
    Target.Value = UCase(Target.Value)
  Else
    blnChanged = False
  End If
End Sub


-then close the VB Editor
-and type text anywhere in your sheet

HTH:O)Bruintje
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6930604
Bruintje, your comment went to the wrong q :-)
CHeers
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6930612
girishnayaks :
In VB, you can do this in several methods, but will probably not be as efficient as windows method...

You can scan all the folders, open the files in readonly mode, and verify if your search text is in this file.

The main problem is the recursivity of scanning the folders, as the VB dir() command does not support recursivity by it's design. You must either build some routine around it, or use the Scripting.Filesystemobject classes for example.

If you have any q to the different steps...

CHeers

 

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 44

Expert Comment

by:bruintje
ID: 6930821
yup indeed, and i don't get any updates, sorry for the confusion and thread polution
0
 

Author Comment

by:girishnayaks
ID: 6932963
Thanks But Im Sure there are some API to do this ans there are find file API's. Please Help Me..
0
 
LVL 3

Accepted Solution

by:
sridhar_PJ earned 600 total points
ID: 6936250
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question