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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filesearch problem 4

Status
Not open for further replies.

grobbu

Programmer
Jun 25, 2002
40
BE
Hello all,

as many of you probably know microsoft isn't invluding the filesearch object anymore in office 2007. There are some people writin a replacement. You can follow there efforts here :
Meanwhile I've got a big problem because our main tool isn't working anymore. I didn't write the ap and my vba skills just aren't enough to rewrite this. So my question..Can anybody help me out to rewrite this little piece of code to get it working again. I already tried but i just can't do it :(

this is the code:
With Application.FileSearch
.NewSearch
.LookIn = CurrentDbDir() + "Sjablonen\Documenten\"
.SearchSubFolders = True
'--------------------------------
'- Zoeken naar Word-sjablonen -
'--------------------------------
.FileName = "*.dot"
If .Execute(msoSortByFileName, msoSortOrderAscending) > 0 Then
For i = 1 To .FoundFiles.Count
Lengte = Len(.FoundFiles(i))
If Left$(.FoundFiles(i), 2) <> "~$" Then
Me.Sjabloon = Mid$(.FoundFiles(i), 28, (Lengte - 31))
Me.VolledigePath = .FoundFiles(i)
DoCmd.OpenQuery "qrySjabloonToevoegen"
Else
MsgBox "Else"
End If
Next i
Else
MsgBox "Er zijn geen bestanden gevonden"
End If
'--------------------------------
'- Zoeken naar Excel-sjablonen -
'--------------------------------
.FileName = "*.xlt"
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
Lengte = Len(.FoundFiles(i))
Me.Sjabloon = Mid$(.FoundFiles(i), 28, (Lengte - 31))
Me.VolledigePath = .FoundFiles(i)
DoCmd.OpenQuery "qrySjabloonToevoegen"
Next i
End If
End With

Thanks to all help!
grob
 
I know, I know. It's taken ages but I've got a bit of time free next week that I should be able to get most of this finished in. Finally! [wink]

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
And a star from me.

"A little piece of heaven
without that awkward dying part."

advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)

Gerry
 
Thanks for the stars everyone, as I say, a fuller and more robust solution is on the way sometime soon (yes strongm, I know, it's been too long already, work commitments and study have been top priority this week I'm afraid).

Gerry, I know it's not finished but out of interest how did it hold up against how you use FileSearch?

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Hi,

Just wondering if a fuller version was completed - and if it supported the PropertyTests feature

Thanks in advance

Charlie
 
I know, I know, cheers Mr Strong... [tongue]

The current development version does indeed support PropertyTests but is still not in a release state unfortunately.

Work commitments and study are still taking priority at the moment I'm afraid but I will try and borrow a work laptop (only got a linux box at home, currently upgrading my windows machine) and try and get it at least publish-able.

Regards

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before post
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top