Solved

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

Posted on 2002-04-09
6
276 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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 200 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

710 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