Results 1 to 2 of 2
Thread: DIR command (VB6 and Word97 VBA)
2003-07-01, 17:04 #1JustCallMeAlGuest
DIR command (VB6 and Word97 VBA)
I have been having some wierd happenings with the DIR command. Simply put, it will not show all the files meeting the criteria.
Specifically, I have 300 *.doc files in a directory (this happens in both network drives and local drives). When I run the following code, it only prints out 199 of them. Suggestions?
<pre>Public Sub thisisit()
Dim MyPath As String
Dim MyName As String
MyPath = "C:COJKMainTesting*.doc" ' Set the path.
MyName = Dir(MyPath, vbDirectory Or vbHidden Or vbArchive Or vbReadOnly _
Or vbSystem) ' Retrieve the first entry.
Do While MyName <> ""
MyName = Dir
2003-07-01, 17:59 #2
- Join Date
- Feb 2001
- Dublin, Ireland, Republic of
- Thanked 0 Times in 0 Posts
Re: DIR command (VB6 and Word97 VBA)
It probably has more to do with the number of lines you can print to the immediate window, than any problem with your code.
I think the maximum number lines is around 200.