Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Search For Ext in AppDir

Posted on 2006-06-19
1
Medium Priority
?
609 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 800 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

916 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