Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Searching Xls Files For Specific Vb


Is there a program or a way to search xls files for specific visual basic? Kind of like searching for a file in windows, where I could say that I am looking for the term, for example, "activeworkbook" through all excel files and it would tell me which xls files contain a script with "activeworkbook" in it? I wrote a function about 4 months ago and I can't find it and I have hundreds of xls files. i am looking for a quicker way than looking individually.
Thanks for the help as always,
Bob




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Copy Specific Files To Specific Folder
Hi,

i have several files in one folder.
For example 111.mp3, 222.mp3, 333.mp3

On a different folder with the name mp3 i got subfolders
with names 111 and 222 and 333

now i want to check each file in the folder if the files name equals the folder name in the subfolders. if it equals the name, copy the file to the folder.
for example
111.mp3 to folder 111

I have no glue how this works.

can anyone please help me??

thx,

akim123

Searching The Computer For A Specific File
I want my program to search the C: drive (or C:/Program Files) for a specific file (called Forms.CFG). When it finds this file, then stop searching and put the path of the file into a string variable. Is there anyway to do this? I am kind of stuck.

Searching For Specific Mail In Outlook, Again
Hi Again

Unfortunately I have to ask for assistance on this one again, I need to scan my inbox and detect a specific mail, from a specific user with a specific title.
The following is the code that I have but I need it to loop until it finds the specific mail and then save the attachment. At the moment it looks through and then just stops whether it finds the mail or not. I need it to keep on searching until it finds the specified mail, within a specified time frame.
The code:
Sub Timer()

mydate = Date
mydate = Format(mydate, "yyyy-mm-dd")
myday = weekday(mydate, vbSunday)
Miles = myday
DayOfWeek = WeekdayName(Miles, False, vbSunday)
mytime = Time
mytime = Format(mytime, "h:mm")

'THIS CHECKS THE RELEVANT TIME
t = 1
Line16:
mytime = Time
mytime = Format(mytime, "h:mm")
Do Until mytime = "07:30"
mytime = Time
mytime = Format(mytime, "h:mm")
Loop

'THIS CHECKS THE DAY OF THE WEEK
If DayOfWeek = "Saturday" Or DayOfWeek = "Sunday" Then GoTo Line16

'THIS STARTS THE PROCESS IN OUTLOOK
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")

'THIS SETS THE FOLDER TO INBOX
Set myfolder = _
myNameSpace.GetDefaultFolder(olFolderInbox)

'THIS SELECTS THE MAIL TO OPEN
Set myitem = myfolder.Items("cicd's " & mydate)
myitem.Display

'THIS TURNS ON THE MAIL INSPECTOR
Set myitem = Application.ActiveInspector.CurrentItem
Set myattachments = myitem.Attachments

'THIS SAVES THE ATTACHMENT
myattachments.Item(1).SaveAsFile "C:Documents and SettingsdittmemoMy DocumentsMiles DataProjectsBasicRateFilesMelody" & _
myattachments.Item(1).DisplayName

'THIS CLOSES THE OPENED MAIL
myitem.Close

'THIS INFORMS YOU WHEN FILE SAVED
MsgBox "The CICD file has been saved", vbOKOnly

End Sub

Can someone please assist me on this?

Thanks in advance

Miles

Searching A MSHFlexGrid (Highlighting Specific Row)
Hello

I'm working on a CD-Database in which I'm using a MSHFlexGrid to display the records from an Access database (Jet connection). The following is the code for my search function. The code that is bold is what I'm having problems with... It is supposed to:
1. Count number of records in database
2. Loop through the flexgrid
3. If a cell contains the same as what User is searching for, then
4. Make that cells background gray (select it basically).

What happens when I run the code is.. Nothing. I get no error message or anything, so I guess the error is logical. Anyone got any ideas? If not, got ideas for any other methods of solving my problem? I basically just want to highlight a row based on if the cell matches a search term entered by User.



Code:
Private Sub cmdSearch_Click()
Dim strArtist As String, strTitle As String
Dim strArtistFound As String, strTitleFound As String
Dim intTotRecs As Integer
Dim i As Integer

Dim Con1 As ADODB.Connection
Dim Rec1 As ADODB.Recordset

strArtist = txtArtist.Text
strTitle = txtTitle.Text

Set Rec1 = New ADODB.Recordset
Set Con1 = New ADODB.Connection
Con1.Open ("Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=P:Cd-RegisterDatacd.mdb")

If optArtist.Value = True Then
'use sql to search for artist in database
Rec1.Open "SELECT fldArtist, fldTitle from tblCds WHERE fldArtist ='" & strArtist & "';", Con1, adOpenForwardOnly, adLockPessimistic
If Rec1.Fields("fldArtist") < 1 Then
i = MsgBox("No results found", vbOKOnly + vbInformation + vbApplicationModal, "CD Database Search - No Results")
Else
strArtistFound = Rec1.Fields("fldArtist") 'then the result assigned to var
strTitleFound = Rec1.Fields("fldTitle")
i = MsgBox("Results: " & strArtistFound & " - " & strTitleFound, vbOKOnly + vbInformation, "CD Database - Search Results") 'display results
'the following is supposed to highlight the row with the result
frmSearch.Hide
frmMain.Show
Rec1.Close
Rec1.Open ("SELECT * FROM tblCds ORDER BY fldArtist")
Do While Not Rec1.EOF
intTotRecs = intTotRecs + 1
Rec1.MoveNext
Loop
Rec1.Close
frmMain.dgdCd.Row = 1
For i = 1 To i = intTotRecs
If frmMain.dgdCd.Text = strArtistFound Then
frmMain.dgdCd.CellBackColor = vbRed
End If
frmMain.dgdCd.Row = frmMain.dgdCd.Row + 1
Next i
Exit Sub
End If
ElseIf optTitle.Value = True Then
Rec1.Open "SELECT fldTitle, fldArtist from tblCds WHERE fldTitle ='" & strTitle & "';", Con1, adOpenForwardOnly, adLockPessimistic
If Rec1.Fields("fldTitle") < 1 Then
i = MsgBox("No results found", vbOKOnly + vbInformation + vbApplicationModal, "CD Database - No Search Results")
Else
strTitleFound = Rec1.Fields("fldTitle")
strArtistFound = Rec1.Fields("fldArtist")
i = MsgBox("Results: " & strArtist & " - " & strTitle, vbOKOnly + vbInformation, "CD Database - Search Results")
Exit Sub
End If
End If
Set Rec1 = Nothing
Rec1.Close
Con1.Close

'after clicking ok in the msgbox displaying results, the search-dialog
'should be closed, and the artist selected in the flexgrid.

End Sub
Thanks alot in advance for your help guys. I know that there's alot of knowledge out there on this forum

Searching Filenames For A Specific String
I have a listbox that displays a list of rom titles. I would like to be able to search a particular folder for each rom and change each listbox item according to whether the rom is there or not.

For example:

A list shows:

Acid Drop
Adventure
Adventures of Tron

I only have the roms for, say Acid Drop and Adventrues of Tron so they are coloured green and Adventure is coloured red.

The way I would like to search (just to clarify, if I wasn't clear before) is to use the strings in the listbox to search the filenames, within a folder, to see if the roms are there, again, eg:

The search string is "Acid Drop" and the rom filename will be "Acid Drop (JUE).a26"

Is this possible?

Sorry for the bad explanation.

Thanks.

Searching An Array For A Specific Entry
Howdy,

I have an array containing different IP addresses. My program needs to check an incoming winsock connection IP against this array - if the incoming connection ip matches one in the array then it should continue as normal, if it doesn't it should close the connection. I have tried several different ways of doing this (mainly a loop, with an if statement in it) but none of them seem to be working as they should. Anybody have any links or example code for searching arrays they could share with me?

Cheers,
Matt.

Help With Searching A Specific Table Required
Hi there,

I am new to VB and Access 2000 and am trying to update a search for books in various libraries.

I am updating a form where I can enter a string value to search for. This search then searches through all of the libraries everything that matches the string whereever it is in the term.

Most importantly, I want to make the search specific to the library I am browsing by using the library id, and then I want the search to only search from the beginning of the title.

I have a field on my form that states the library id but I have no idea how to make the search only focus on books that match the library id that the form is open on (lib_id).

the code is below:

Private Sub cmdgo_Click()
Dim strsql As String

strsql = "select book_id, title from library_title where title LIKE ""*" & txtsearch & "*"" ORDER BY title;"
Me!listresults.RowSource = strsql

End Sub

Any help is greatly appreciated.

Thanks

Ben

Searching File For Specific Text, And Replacing It.
Hello,

I haven't programmed in years, and just want some ideas how to go about doing something. I am also new to this forum. I have a file that looks something like this:
AIX concord 2 5 000AD85D4C00 07/04/06

System Configuration: lcpu=4

08:00:00 %usr %sys %wio %idle

What I want to do is search for the line that contains "System Configuration: lcpu=4" and delete it. I also want to delete the empty line below that line. I started of small by seeing if I can write to a file, and also replacing the text within a file. But for me, this is a bit more complicated. I read a bit about the replace function, but I want to find that line of text, and delete the two lines below it. Any idea?

Thank you.

Searching For Specific Text In A Disk File
Ok, I'm pretty new to Visual Basic, and I'm attempting to write my first program. I've been able to find or figure out most of what I need, but I'm stuck on this part. I'm using a disk file (a notepad document, to be more specific) to store records. I want the program to search for a certian string of text and be able to use that and the lines that follow it to input information into a listbox. I know how to imput the info. I just basically need to know how to search for it.

HELP QUICKLY! Searching A Listbox For Specific Charectors
Ok. I have a listbox with about a hundred items in it. How can I go thru it line by line and have it do the following.

I need it to look for a sequence of 10 spaces, and remove the 10 spaces and all text after it. Then I want the remaining line to be added to a different listbox.

Thanks for any help anyone can give

Searching For A Specific Field In Access Table
hi
I am trying to match a user given string value with an existing value in a table , can anyone pls tell me how to do it. Also how do i get a Select statement value in to a single Str variable.

Thanx

Searching For Specific Folders On User's Drive
Anybody know of a simple vbcode for searching through a drive to get folders'name and path only. The folders found would only contains 2 specific file types( one of which, predetermined by user)
So I need to return these specific folders only.
I'm using treeview for manual search but would like to add automatic search when app loads.

Thanks all for your help

Treeview - Searching Nodes For Specific String
Hi.. I have applied this code for searching a specific string in a treeview.
The problem is that this code searches only the parent nodes
and I want to search everything...
Is it possible to suggest me any modifications or an entirely new approach?

Thanks in advance!

----------------------------------------------


Option Explicit
Public tvwSearch As TreeView
Dim iStart%
Dim iPass%


Private Sub cmdFind_Click()
Dim strToFind$, iIndex%
Dim blnFound As Boolean
strToFind = LCase$(txtFind)
With tvwSearch
'check not on child node and an item selected
If .SelectedItem Is Nothing Then
iStart = 1
.SelectedItem = .Nodes(iStart)
ElseIf Not .SelectedItem.Parent Is Nothing Then
iStart = .SelectedItem.Parent.Index
Else
iStart = .Nodes(.SelectedItem.Index).Next.Index
End If
LOOKAGAIN:
Screen.MousePointer = vbHourglass
iIndex = iStart
'loop through nodes looking for the text
Do
'check for matching whole entry
If chkWhole Then
'match all of entry
If .Nodes(iIndex) = strToFind Then blnFound = True
Else
'match part entry
If LCase$(.Nodes(iIndex)) Like "*" & strToFind & "*" Then blnFound = True
End If
If blnFound Then
.SelectedItem = .Nodes(iIndex)
.Nodes(.SelectedItem.Index).EnsureVisible
cmdFind.Caption = "&Find Next"
Screen.MousePointer = vbDefault
Exit Sub
End If
iIndex = .Nodes(iIndex).Next.Index
Loop While Not iIndex = .Nodes(iStart).LastSibling.Index
Screen.MousePointer = vbDefault
'If we started lower down the tree and haven't found the string
If Not blnFound And iPass = 0 Then
'see if user wants to search from top of tree
If MsgBox(strToFind & " was not found." & vbCrLf & "Search from beginning?", _
vbQuestion + vbYesNo, "Not Found") = vbNo Then
.SelectedItem = .Nodes(iStart)
Unload Me
Exit Sub
End If
'select first node and search again
iStart = 1
iPass = 1
Goto LOOKAGAIN
Else
'notify user that text not found
MsgBox strToFind & " was not found.", vbInformation, "Not Found"
cmdFind.Caption = "&Find"
iPass = 0
iStart = 0
txtFind.SetFocus
txtFind.SelStart = 0
txtFind.SelLength = Len(txtFind)
End If
End With
End Sub

Private Sub Form_Load()
iStart = 0
iPass = 0
End Sub

Searching Text And Retrieving Specific Data
I need to retrieve specific data from a text file. See below as an example text file

XF 5.00000
ZF 5.00000
X-6.19800 Z58.27380 ;Start Position
X-5.22300 Z59.96260 ;End Position

In this example, I would like to assign my variables as the following: X(0) as '-6.19800', Z(0) as '58.27380', X(1) as '-5.22300', and finally Z(1) as '59.96260' (keep in mind that the numbers will change, but the X and Z labels remain the same).
I can load the file, but I don't know how to search that particular file and extract the specific information.

Any ideas?

Thanks.

Searching A Network Drive For A Specific Folder Name
Hi everyone,

We have a large project drive at work and sometimes our users want us to search for a specific folder or file within our directory. This can be very difficult especially if they don't know where this folder or file sits. I know I can do a simple Windows search but that takes too long. I also want to be able to specify the depth of the tree...for example I want the program to search within one sub-folder only, if not found move to the next folder...i.e. in the example below I want to search by "310002234", and I know that this number is only 2 levels deep in my tree...so I don't want it to search under Drawings and Internal as it is a waste of time....I hope I haven't made this too confusing...anyways, any help would be greatly appreciated.

Regards,
Adeel


Data
  --> Project 1
  -------> Drawings
  -------> Client Emails
  -------> Internal
  -------> Logistics
  -------> 3100202232
  --> Project 2
  -------> Drawings
  -------> Client Emails
  -------> Internal
  -------> Logistics
  -------> 310002234
  --> Project 3
  -------> Drawings
  -------> Client Emails
  -------> Internal
  -------> Logistics
  -------> 234234234

Searching, Writing And Deleting Specific Registry Items.
I'm looking for someone who can help me or point me to a guide on how i can get my form to search for, create and delete specific registry items from windows. I want this to happen when, for example CmdBttn1 is executed. Can anyone help? Thx ~N~ advance.

~Nemo

[SORTED]Searching Specific Line In Text File?
I have a text file with about 84 lines of text or so. What i'm trying to do it when someone types 32 in a box then a string is changed to what is on line 32 in the text file.

For example if line 64 is hello, when the user types in line 64 in the textbox then the string MyString will = hello.

I want this to be as easy as possible please. Im currently using


VB Code:
Open App.Path & "worlds.txt" For Input As #1Line Input #1, WLine  MsgBox WLineClose #1


But can't seem to edit it to search a specific line.

Thanlks in advance!!

Searching The Hard Drive For Specific File Types... Doc .mp3 .jpg Ect
i am making a program that is similar to the windows file find thing. and i need to know how to display differen't files from differen't places in the comp in a box like the load/save screen that word 2000 has.

i also need to know how to search the entire hard drive for specific types of files, such as .doc .mp3 .txt .jpg and such and retrieve them and list them in the file box i refered to in the first paragraph

any help would be really appreciated as always

-The Evil Eye

Badly Need A Viasualbasic 6.0 Code For Searching Specific Record
Hi to All:

Greetings for continued peace and prosperity!



I am working on a form with a command button (cmdbttnSearch) tha can search for specific member from a database table (dbase I format). This button is dependent on a user=92s input (member=92 Last Name, w/c refers to the database table=92s LASTNAME field from a textbox object (txtboxLASTNAME). I have a data objec (data1) which connects to the database table. Below is my searc code:

Private Sub Command1_Click()

If Text1.Text <> "" Then

SearchStr$ = Text1

Data1.Recordset.Index = "LASTNAME" 'uses the LASTNAME a the index

Data1.Recordset.Seek "=", SearchStr$ 'searches a recor based on the SearchStr$ value

If Data1.Recordset.NoMatch Then 'if no match

Data1.Recordset.MoveLast 'go to last record

End If

End Sub


If the search button finds a matching record as that of th textbox value (in this case, a member=92s Last Name) it display detailed information regarding a member using nine (9) Labe objects. From here, I find an obvious problem: the search butto does not actually return the expected member record bein searched for. Rather, it returns random records matching th textbox value (Last Name). This is too time-consuming an tiresome on the part of the user, since, the user has to mak use of the data object=92s record selector until it reaches th expected searched member record. What if I=92ll be dealing with very large database table in the future?

I know that I badly need the FIRSTNAME field of the databas table to get involved to solve this problem. Though I have trie many times, still I have not figured out the appropriate code t make this work.

Please I badly need your hand on this matter. I know with you expertise you can get me out of this problem.

I deeply appreciate your help on these matter.

Thank you very much in advance and more power!



Piolo

Searching For Specific Text In Outlook Subject Line
Hi all,

My idea is this...

I have set my Outlook client to check the subject line of all emails received and once it finds one that contains the text "server_prog-" it runs the following .exe file.
Now I want this file to get the "from address" and "subject line" of the email and analyse it as it will contain parameters (ie. server_prog-reboot server 3), and the "from address" will be a security check (I might also use a security code in the body of the message for added security).

I need help getting the details from the email, at the moment I can make Outlook trigger my application, but then I'm stumped. I downloaded the following code in the hope I could tweak it to suit my requirements, but am running into problems. Any help or even sugestions on a better way of doing it would be very much appreciated.


    Private Sub Main()
        ' The following example will show a message box with the Sender's Name and email address for all messages in the current Outlook folder:
        Dim onsMapi As Outlook.NameSpace
        Dim ofolderSource As Outlook.MAPIFolder
        Dim omsgItem As Outlook.MailItem
        Dim strReport As String
        ' Get the current Folder
        onsMapi = Application.GetNamespace("MAPI")
        ofolderSource = Application.ActiveExplorer.CurrentFolder
        ' Check for messages in Folder
        If ofolderSource.Items.Count = 0 Then
            strReport = "No Mail Items in current Folder"
        Else
            For Each omsgItem In ofolderSource.Items
                ' Get the Sender's name and Email address
                strReport = strReport & omsgItem.SenderName & " / " & GetSenderID(omsgItem) & vbCrLf
            Next
        End If

        MsgBox(strReport)

        ' Clean Up
        ofolderSource = Nothing
        onsMapi = Nothing
        omsgItem = Nothing

    End Sub

    Function GetSenderID(ByVal objMsg As Outlook.MailItem) As String
        'This function returns an email's Sender ID as someone@somewhere.com

        On Error GoTo ErrHndlr

        Dim objCDOMsg As MAPI.Message
        Dim objSession As MAPI.Session
        Dim strEntryID As String
        Dim strStoreID As String

        objSession = CreateObject("MAPI.Session")
        'Logon to existing session.
        objSession.Logon("", "", False, False)
        ' Get message Information
        strEntryID = objMsg.EntryID
        strStoreID = objMsg.Parent.StoreID
        ' Get the message
        objCDOMsg = objSession.GetMessage(strEntryID, strStoreID)
        ' Extract the Sender's Address and Return value
        GetSenderID = objCDOMsg.Sender.Address

        ' Clean Up
        objCDOMsg = Nothing
        objSession.Logoff()
        objSession = Nothing
        Exit Function

ErrHndlr:
        MsgBox(Err.Description)

    End Function


The following lines are giving me errors...
        onsMapi = Application.GetNamespace("MAPI") ' 'GetNamespace' is not a member of 'Systems.Windows.Forms.Application'
        ofolderSource = Application.ActiveExplorer.CurrentFolder ' 'ActiveExplorer' is not a member of 'Systems.Windows.Forms.Application'
        For Each omsgItem In ofolderSource.Items ' Expression of type 'Outlook.Items', which is not a collection type

Thanks,

Rob

Searching Specific Lines Of Text In A File *** RESOLVED ***
Hi, I am writing a small app that will read a file, look for a particular word, and then display a message.
The problem is, I want to search only specific lines in the text, primarily the last 2 lines. This is the code I have so far:

Code:
Private Sub cmdReadIt_Click()
Dim fso As New FileSystemObject
Dim fsoStream As TextStream
Dim strLine As String
Dim strpos As Integer
Set f = fso.GetFile("C:\000ServerMessages.log")
Set fsoStream = f.OpenAsTextStream(ForReading)

Do While Not fsoStream.AtEndOfStream
   
 strLine = fsoStream.ReadLine

    strpos = InStr(strpos + 1, strLine, "Failed") 'find string Failed
    
    If strpos > 0 Then
        MsgBox "Found it"
        
    End If
Loop


End Sub




How can I search only the last two lines (or only the last line) of text? Below is a sample of the text file



2/8/2005 1:00:20 AM Clocksrv.exe: Running, Disconnected
2/8/2005 1:00:20 AM Archiving Database...
2/8/2005 1:00:30 AM Archiving Complete
2/8/2005 1:00:31 AM Backup Failed.



The code works, it finds the keyword I am looking for - however, I only want it to display the message if the keyword is in the last line - basically, to alert someone if a backup has failed. As of now, the message gets displayed regardless of what line the keyword is found on.

I appreciate any help you are able to give.



Edited by - doobielg on 2/15/2005 5:17:36 PM

Browsing Into Zip Files And Finding Specific Files ?
I found a module that has ZIP functionality features - but it's got no comments on how to pass an argument or request to it...

What I'm trying to do is:
> Find all *.zip files in a directory (*.zip in (say) C:MyFolder)
> Browse into each zip file and search for specific files (find any files that end in (say) *.txt)
> Load those files into a list box


I'd really appreciate any help - and espically the location of a zip functionality module that has comments or insturctions on how to use it.

Thanks!

Searching/Replace Text Fields For Specific Text
Hey,

Im making a program like a textpad/notepad.

Can anyone tell me how to make (pls):

A find:

user enters text in textfield, and computer looks for it in a textfield, if found, it highlights it.. if not found, a msgbox appears saying "Not found"


thanks
l8er

App Specific Files
I have a VB 6 program - it is not a Dbase program - it is stand alone. It uses files of type ".xxx" as its project files. (These are really text files since I don't register them)


My program allows the user to work on multiple ".xxx" files - but I don't want the user to be able to open the same ".xxx" file more than once - right now they can - I want to prevent this.


If I just keep a list of the file names - I could prevent this for a single instance of my program. But, if they run multiple instances of my program - the list of file names does not help. I could lock open ".xxx" files. But I hesitate to leave files open just to lock them. Then I thought I could prevent multiple instances of my program altogether with App.PrevInstance.


How would others handle this? I would really appreciate any thoughts. Thanks.

Finding Specific Files
Alright, this is my first post on this site! hope this ends up well... Basically there is a program I am trying to make an add-on to and this program saves information in
c:documents and settings*user*application dataprogramZ
my problem is in order for my add-on to work it needs to access these files; however I don't know how to find the *user* part through visual basic... any help would be greatly appreciated! thanks in advance, and I hope to get more help and someday help others on this forum...

-chasenyc

Specific Excel Files
I have the code below which allows me to export text boxes into Excel Cells in a new workbook, but I actually want to export them into a specific excel file in the directory (C:PICOadc16.xls).
What do I have to alter to achieve this?
Thanks
###################
Private Sub cmdNext_Click()

Dim RetVal
Dim wb As Workbook
Dim ws As Worksheet
excel.Application.Visible = True

Dim oXL As excel.Application
Dim oWB As excel.Workbook
Dim oSheet As excel.Worksheet
Dim oRng As excel.Range

'Start Excel and get Apllication object
Set oXL = CreateObject("Excel.Application")
oXL.Visible = True

Set wb = Workbooks.Add
'Set ws = Worksheets.Add
Set ws = wb.ActiveSheet 'Should default to sheet1
excel.Application.Visible = True

ws.Range("A1").Value = lblJobNo.Caption
ws.Range("A2").Value = lblJob.Caption
ws.Range("A3").Value = lblClient.Caption
ws.Range("A4").Value = "Date"
ws.Range("A5").Value = lblBorehole.Caption
ws.Range("A6").Value = lblTestNo.Caption
ws.Range("A7").Value = lblOperator.Caption
ws.Range("A8").Value = lblDepth.Caption
ws.Range("A10").Value = lblNotes.Caption

ws.Range("C1").Value = txtNumber.Text
ws.Range("C2").Value = txtJob.Text
ws.Range("C3").Value = txtClient.Text
ws.Range("C4").Value = txtDate.Text
ws.Range("C5").Value = txtBorehole.Text
ws.Range("C6").Value = txtTestNo.Text
ws.Range("C7").Value = txtOperator.Text
ws.Range("C8").Value = txtDepth.Text
ws.Range("C10").Value = txtNotes.Text

Unload Me
'Specifying 1 as the 2nd argument opens the application in normal size & gives it the focus.
RetVal = Shell("C:PICOplw32.EXE", 1) ' Run PicoLog Recorder.
End Sub
###############

How To Open Non Specific Files
im opening a text file (into a text box) with the common dialog control, and i can read a specific file with this code,
but im trying to find a way so that if i change to a different file it will open that as well? this is in VB6

Private Sub OpenFile()
    Dim strText As String
    Dim strTemp As String
    Dim FileName As String
    
    mintFileNumber = FreeFile 'get next available file number
    Open "test.txt" For Input As #mintFileNumber
    Do Until EOF(mintFileNumber)
        Input #mintFileNumber, strText
        strTemp = strTemp & strText & vbCrLf
    Loop
    Close #mintFileNumber
    txtDisplay.Text = strTemp
End Sub

Copy Files With A Specific Extension
I keep on getting error when i try to copy all files with a specific extension.

FileCopy "c:Off-line*.bbl", "c:windows*.bbl"

Any suggestions?

Thanks

Installing Files In Specific Directories
Hi

Can anyone help me on the installtion problem I have. I want a certain file to be copied to a certain directory i.e. c:mydirectory. How do I specify this in the deployment wizard?

Thanks

Delete All Files Containing Specific String
Hello

I'd like to ask how can i delete all files in a specific directory which contains a specific string?
Would you please post a code for that?

Thanks
Cheers
Adel

Verify The Existance Of Specific Files
hey guys

skip to WHAT I NEED YOUR HELP WITH if you want

BACKGROUND:
i'm writing a very small app which "toggles" files.
the idea is to rename a bunch of files in a games directory in order that a modded version, or the original version of the game will play.

the files that the game uses are files.ext
if the original files are in use then the mod files will be present as
MODfiles.ext
if the modded files are in use then the original files will be present as
ORIGfiles.ext

then upon execution[to implement the mod]
the original files.ext are remaed as ORIGfiles.ext
the MODfiles.ext are renmaed as files.ext

thus replacing the original file with a modded version and backing up the original.

To restore the ORIGfiles.ext
files.ext are renamed as MODfiles.ext
ORIGfiles.ext are renamed as files.ext
*********************************************************

NOW HERE IS
WHAT I NEED YOUR HELP WITH

when the app loads (form load)
i want it to check 2 Things

1 >files.ext are all present in the appropriate folder[s]

2 >either MODfiles.ext OR ORIGfiles.ext are all present in the appropriate folders[s]

i've look on the forums quite a reakon i could prob do it a long way
was just wondering if there was a simple command like

checkforfile(filename,filepath)
which would return true or false?

Finding Files With A Specific Extension
Hi,
I need to check if there are specific files (with extension .img) present on the computer.
Does someone know how this could be accomplished.
I already tried it through some api functions but I can't give any wild cards with them.

THANKS.

Creating A Program Specific Files
I am creating an application that allows the user to create templates for later use by the application.  I was planning on creating .txt files, but I was toying with the idea of creating  a file with a new extension that is specific to my application.  If I was to do that, I am not sure how to read the test data in the file.  Can anyone provide some direction (or even tell me if this is a waste of time).  I was just thinking that this could be a learning experience for me.  TIA...

How Do I Do To Find A Specific Function In API Files?
Hi all!!

I need to change my vb project to activate the program (already resident in memory) by pressing a shortcut key. Is there someone to tell me how to do that or some piece of code about it?

Thanks in advance.

Find Files In A Specific Folder
I have a folder in the application path where are saved some text files. Now I want automatically with a sub procedure to find one by one these text files (sequentially) and present to a Rich textbox their content. So far I have tried to make this through the Filesystemobject but my attempt has failed. Here is a sample of my code:

Dim ObjFSO As New Scripting.FileSystemObject
If ObjFSO.FolderExists(PathAnnotationFiles) Then
   Dim ObjFolder
   Set ObjFolder = ObjFSO.GetFolder(PathAnnotationFiles)
   Dim ObjFile
   For Each ObjFile In ObjFolder.Files
       Label1.Caption = ObjFile.GetFileName
   Next

Saving Files To Specific Locations Using VBA
Hi everybody.

I need generic code to add a new workbook & save it using a filename format & for some reason the code below is not working.

What I am trying to do ultimately is, from a master annual workbook,
add a new workbook to a subfolder named after the relevant month (03 for March etc) & save to that folder as "DC" & mm (march would be DC03). This file is known as the monthly master as there could be up to 10 CSV files per month to be consolidated into the master monthly.

I then do other things with these montly files to consolidate into annual file but for the moment I have this key problem & this is what I have

Needed to use ChDir command with Filepath string variables

Code:Set NewBook = Workbooks.Add
            With NewBook
                .Title = "DC08" & mnth
                .Subject = "DC"
                .SaveAs Filename:="C:Documents and SettingsNew OwnerMy DocumentsATBNZ TransactionsHist8DC" _
                & mnth & "" & "DC08" & mnth
            End With

It won't save the file to the folder I am trying to nominate by user input called "mnth". So I want create a master file for the month & save that file in the monthly folder.

My code works as separate operations but there is still a bit of automation I can do as one coding operation.

I also need this as I have 2 other operations I do monthly that will use this code.

Cheers for any help


Time takes time & is natures way of preventing everything from happening at once!
Noobie VB.Net 2003/FW1.1
Be patient with me as "it is a long way to the top if ya wana rock & roll!" - ACDC

Edited by - echo2 on 3/29/2008 6:32:57 PM

How To Get The Files Present In A Specific Folder
I want to get the names of files in a string, present in a given folder one by one.

Dont wann use that drive/folder list.

Any methods to do it?

Getting A Listing Of Files In A Specific Directory
Does anyone know how I could get a listing of a particular directory using wild cards like the way we did it in DOS?

ie. dir file2??.txt

In addition, is it possible to rename this list of files in some sort of loop? I also need to know how to rename directories, and all of these tasks must be able to work with ASP. Thanks much.

DA

Searching Through Files
I can't find some code to do this, but i want to search through text files under 50kb and if they contain certain words (on their own or mixed eg. sfkfekHAPPYBIRTHDAYnfkfjiodfj) and then copy them to the C: drive (or a drive if possible)

ANy Ideas? I would be gratefull.

Searching Txt Files
Hi,

I am making a Video Store Rental program for a project. Attached is my txt file with over 2000 movies and there status. What I want to do is havce a textbox and have the user able to enter a movie they want(even if they spell the title wrong or just enter one word) and display the results in order. However, Im not sure how to search the file to get this informaiton. Can anyone please guide me?

Thanks

Searching Files
if i have the computername and the workgroupname can i use Dir$() to search his computer for files ?

Searching For Files
ok this ones more difficult...
this game i have, theres the option to install it on the menu. what i want is also a 'play' button that runs the games .exe file after installation.

however, i want the play button to be disabled if the game is not installed, so i need to search for Game.exe to make sure its in the install directory before you can run it

also, if the game is not installed in the default directory how do i find out where it is?

Searching For Files
Hi Guys,

I have a small question... i'm not too sure how i'm to approach this... so i need someone to tell me what to do...

I need to find a file on a specified directory and i need to exectue the file at the same time...

Take for instance Test.txt... it's in this directory and i need to find this file and execute it automatically the minute i open the directory... how do i get this done...

Thanks in advance...

~JohN~

Searching For Files
Hey there,

I just have one question, does anyone out there know the command on how to seach a for example ".pdf" file within a directory...

Thank you for you coorperation
have a nice day!

Searching For Files
is it possible to search say the hard drive for a file type like jpg?

Searching Files
Hey, I'm searching a directory of about 215 files. I need to get to the file's properties and see exactly what that file is. I'm using DSOFile to do this. But by doing this, I have to grab and open every single file to read it's properties and do my operations on it if I have to. This takes about 15 seconds to do. Is there any faster way of doing this? I did speed the search up to about 5 seconds by specifying which file names to search for but it gets more complicated than this and I can not do it that way. I'm stuck on how to get to the easiest solution. If there isn't a faster search than using DSOFile and searching each file then my program will probably become gigantic. Anyone want to help out and talk to me about this?

Searching Certain Files
if i am using this line with a commondialog.

.Filter = "Wave files (*.wav)|*.wav"

how would i make it look for mp3 and wav.


thanks
thingimijig.

Searching .dat Files
I was wondering if it was possible in VB6 to search a folder full of .dat files for a specific word in a .dat file? For instance, would I be able to make a program that searches for the word 'wire' in all of the .dat files in a folder then return a list of the files that contain the word?

Searching Through CSV Files
hi there
i have a csv file with 2 colums
namely <uid>,<accessid>

now on my vb form
i ask user to enter the uid
i want to check this uid against all the uid records in the csv file and get for myself the accessid

can any1 help me code this

i can write csv files ..
but never tried to search thru one be4..
if someone can help me with this code...it will be most appreciable..
thnx a lot

Copyright © 2005-08 www.BigResource.com, All rights reserved