Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching and Finding a string of Characters

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I need to do a search throw a number of Microsoft Word Documents and Search by finding the first 4 characters of a part # and Capitalizing them. The part numbers are 8-10 char long.

Thanks

dave
 
try looking up Instr, Replace and UCase.

HTH


______________________________
- David Lanouette
- Lanouette Consulting, LLC
- DLanouette@Computer.org
 

Something like
-----------------------------------------------------------
Dim InFile As Byte, FileStr As String
Dim Pos As Long, CapStr As String

CapStr = "my text to capitalize"
InFile = FreeFile
Open "thefile.doc" For Binary As #InFile
FileStr = String(LOF(InFile), " ")
Get #InFile, 1, FileStr


Pos = InStr(FileStr, CapStr)
While Pos > 0
For i = 0 To Len(CapStr)
Put #InFile, Pos + i, UCase(Mid(CapStr, Pos, 1))
Next i
Pos = InStr(FileStr, CapStr)
Wend
close InFile
------------------------------------------------------------

I'm not sure it works, but its got to be close...

Sunaj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top