- Private Sub CommandButton1_Click()
-
Dim fd As FileDialog
-
-
Set fd = Application.FileDialog(msoFileDialogFolderPicker)
-
-
fd.InitialFileName = ActiveWorkbook.Path
-
fd.Show
-
-
On Error Resume Next
-
-
jdcfwLogFilePath = fd.SelectedItems(1)
-
-
If Err.Number <> 0 Then
-
Exit Sub
-
End If
-
-
If jdcfwLogFilePath = "False" Then Exit Sub
-
DriveTextBox.Text = jdcfwLogFilePath
-
-
End Sub
-
-
Private Sub CommandButton2_Click()
-
Dim i As Integer
-
Dim myFile As String
-
Dim endTerm As String
-
endTerm = FileNameTextBox.Text
-
Const wdFindContinue As Integer = 1
-
'checking textbox is empty
-
-
If FileNameTextBox.Text = "" Then
-
MsgBox "Please Enter Keyword"
-
Else
-
-
'Search criteria
-
With Application.FileSearch
-
.LookIn = DriveTextBox.Text 'path to look in
-
.FileType = msoFileTypeAllFiles
-
.SearchSubFolders = True
-
.TextOrProperty = "*" & endTerm & "*" 'Word to find in this line
-
.Execute 'start search
-
-
'This loop will bring up a message box with the name of
-
'each file that meets the search criteria
-
-
Dim n As Integer
-
n = 0
-
For i = 1 To .FoundFiles.Count
-
-
ListBox1.AddItem (.FoundFiles(i))
-
n = n + 1
-
Next i
-
-
End With
-
End If
-
If n = 0 And FileNameTextBox.Text <> "" Then
-
MsgBox ("Keyword Not found")
-
End If
-
-
End Sub
-
-
Private Sub TextBox2_Change()
-
-
End Sub
-
-
Private Sub ListBox1_Click()
-
-
End Sub
-
-
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
-
Dim endTerm As String
-
endTerm = FileNameTextBox.Text
-
Const wdFindContinue As Integer = 1
-
'MsgBox (ListBox1.Text)
-
Set wordApp = CreateObject("word.Application")
-
-
wordApp.Documents.Open ListBox1.Text
-
-
wordApp.Visible = True
-
-
If Not IsMissing(endTerm) Then
-
With wordApp.Application.Selection.Find
-
.Text = endTerm
-
'<i>.HighlightColorIndex = wdYellow</i>
-
.Forward = True
-
.Wrap = wdFindContinue
-
.Format = False
-
.MatchCase = False
-
.MatchWholeWord = False
-
.MatchWildcards = False
-
.MatchSoundsLike = False
-
.MatchAllWordForms = False
-
.Execute
-
-
End With
-
End If
-
-
End Sub
11 1983
I am having two text box. first text box i am entering the file name(d:\search)using the browse button.second text box i am entering the keyword(appication).it will automatically find the document files and list the listbox.if i am double clicking the list inside the search document means it will automatically open the word file and notify the keyword.
Now my doubt is fist text box i am giving the document file directly cant used for browser.How can i do.... If anybody known means plz help me
I don't understand what your question is. Please try explaining again with a clearer and more concise statement.
I've been trying really hard to understand the question. What I've worked out is that this is not VB6 code, but VBA. Presumably a Word macro.
If so, please post your question in the VBA forum, as you'll find much more expertise there.
Also, I'm afraid the question as originally posed is quite difficult to interpret. I gather it's something to do with the file/folder dialogue shown at line 7, and some sort of problem with either setting the starting folder or file name, or making use of the value that it returns. Can you please try to clarify? (Note: the word is "question", not "doubt").
Actually my project is to search a particular keyword from a file, under that key word few lines has to be retrieved "
steps:
Give a filename(ex.raja.doc)
Give a Keyword(ex.string)
Search the filename in whole computer(c:,d:...)
match the keyword.
if the keyword is found, retrieve few lines under the keyword from that file.
Actually i have done upto this
But the problem is table,
if the table presents under the keyword, then how can i retrieve that table.
Thanks
by
azhaguraju
im waiting for your reply
i have finished to search ms word files in folder only i want to search ms word files in directory(my computer)if anyone known means plz update
Folder and directory are the same thing. I still don't know what you are trying to ask.
Actually my project is to search a particular keyword from a file, under that key word few lines has to be retrieved "
steps:
Give a filename(ex.raja.doc)
Give a Keyword(ex.string)
Search the filename in whole computer(c:,d:...)
match the keyword.
if the keyword is found, retrieve few lines under the keyword from that file.
Actually i have done upto this
But the problem is table,
if the table presents under the keyword, then how can i retrieve that table.
Rabbit Sir If you know means plz update soon
You've already said all that. You have added no new information. I didn't understand what you were trying to ask the first time and I'm not going to understand it if you just keep repeating what you said.
Please rethink and rephrase your question in a different way.
my project is to search a particular keyword from a document file, under that key word few lines has to be retrieved "
if the keyword is found, retrieve few lines under the keyword from that file.i have done upto this
But if the table presents under the keyword, then how can i retrieve that table.
Can you give your mail id i will send screen shot .you can understand my question
[IMG]D:\azhaguraju\ht.bmp[/IMG]
we want to give a file name in file name text box(for example one.doc)
And we want enter the search keyword in keyword textbox.
if we press search button the function should search in all the directory(like C,D,E including sub folders)for the document have a name mention in the textbox.
if that document found. we have to find that document which contain that particular keyword.
if both condition are true. we have to add that file name with path in the listbox.
in vb 6.0
pls some one help me...thanks in advance....
You keep saying the same stuff over and over. You keep mentioning a table and I have no idea what table you're talking about.
You can't attach an image from your computer like that. We won't be able to see it. You need to upload it first.
Also, please stop bumping your thread. It is against site policy.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: MouseHart |
last post by:
I have a small program which lists my music files on my computer, but I
can't get it to print exactly the way I want it to. The data is viewed in
an MSFlexGrid named "TextGrid" and the following...
|
by: alikhome |
last post by:
Hi!
May be anybody knows...
I want to open word file (or Excel) from IIS server (URL) without
getting security window for input Username and password. I know
Username, Password and Domain. I'm...
|
by: Daniel Walzenbach |
last post by:
Hi,
I need to know how I could populate a word file from within ASP.NET and stream it out to some user (I can rely on all users have at least Word XP installed).
The preferable solution would be...
|
by: CopynPaste |
last post by:
Hi,
I wrote a VB.net program that import a text file, which I will parse and
place into arrays.
My question is how to open an existing Word file without the Dialog Box that
has a 4x10 table and...
|
by: John Salerno |
last post by:
I figured my first step is to install the win32 extension, which I did,
but I can't seem to find any documentation for it. A couple of the links
on Mark Hammond's site don't seem to work.
...
|
by: Ray Muforosky |
last post by:
Hello all:
Task: I want to do file search, using the "conatining text" option from
a web page.
How do I search for a file on my local drive containing a certain
string, from a web page. That...
|
by: Robertico |
last post by:
I'am new to php and have a question about a recursive file search.
I'd like to do a recursive search for jpg-files and add the filenames (full
path) to a mysql database.
I appreciate any help !
...
|
by: piola vago |
last post by:
I'm making an application that monitor a particular file (not a
directoy) and when trigger a change event it start a backup process of
the changed file. I'm using FileSystemWatcher component. My...
|
by: sandeepkedlaya |
last post by:
Hello,
I need to copy images from a folder and copy to a word document. I
have done as follows.. but It copies only last image. Can any one of
you help me in this..
Private Sub Page_Load(ByVal...
|
by: shanmugamit |
last post by:
hi,
i have 2 lacks word file in that i want search the keyword from that word files.
but i using file method it too much time to search data.any one give idea to search data good method like any...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |