Solved

Search For Ext in AppDir

Posted on 2006-06-19
1
579 Views
Last Modified: 2008-01-09
I need to search my app.path dir for a file with ext. (.wrg) i just need the first filename it finds and if it finds more then just debug.print filename
0
Comment
Question by:thaburner
1 Comment
 
LVL 17

Accepted Solution

by:
zzzzzooc earned 200 total points
ID: 16936780
Here's a quick example. Just change ext to "*.wrg".

Form1:
-----------------
Option Explicit
Private Sub Form_Load()
    Dim path As String
    Dim ext As String
    Dim file As String
    path = App.path
    If (Right$(path, 1) <> "\") Then
        path = path & "\"
    End If
    ext = "*.HTM"
    file = Dir(path & ext, vbNormal)
    Do Until file = vbNullString
        Debug.Print file
        file = Dir
    Loop
End Sub
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SSRS expression Issue finding a string 10 93
VBA to copy paste columns form one file to other 20 91
How to debug this code 7 64
VB6 ListBox Question 4 50
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

821 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