Assign file in DIR to string 
Author Message
 Assign file in DIR to string

Does anyone know how to assign the first file in a directory to a string and
then msgbox that file name?

Thanks



Tue, 11 May 2004 14:28:27 GMT  
 Assign file in DIR to string

    Dim s As String
    s = Dir("*.*")
    Do While s <> ""
        If Left(s, 1) <> "." And Not (GetAttr(s) And vbDirectory) Then
            Exit Do
        End If
        s = Dir
    Loop
    If s <> "" Then MsgBox (s)

Quote:
>Does anyone know how to assign the first file in a directory to a string and
>then msgbox that file name?

>Thanks

Regards, Frank


Tue, 11 May 2004 15:19:39 GMT  
 Assign file in DIR to string

open "...i don't get no respect!" for output as #1
print #1, "no respect!"
close #1

Quote:
>     Dim s As String
>     s = Dir("*.*")
>     Do While s <> ""
>         If Left(s, 1) <> "." And Not (GetAttr(s) And vbDirectory) Then
>             Exit Do
>         End If
>         s = Dir
>     Loop
>     If s <> "" Then MsgBox (s)

--
Joe Foster <mailto:jlfoster%40znet.com>     On the cans? <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!


Tue, 11 May 2004 15:58:50 GMT  
 Assign file in DIR to string
On Thu, 22 Nov 2001 23:58:50 -0800, "Joe \"Nuke Me Xemu\" Foster"

Quote:


>open "...i don't get no respect!" for output as #1
>print #1, "no respect!"
>close #1

Whoops,  thanks  i forgot about idio... um.. users.  Old habit
syndrome strikes again. That's how we used to test in DOS. :-)
Anyone saving a file with "." in the name, especially as a leading
character would definitely not get much respect from me.

Quote:
>>     Dim s As String
>>     s = Dir("*.*")
>>     Do While s <> ""
>>         If Left(s, 1) <> "." And Not (GetAttr(s) And vbDirectory) Then
>>             Exit Do
>>         End If
>>         s = Dir
>>     Loop
>>     If s <> "" Then MsgBox (s)

>--
>Joe Foster <mailto:jlfoster%40znet.com>     On the cans? <http://www.xenu.net/>
>WARNING: I cannot be held responsible for the above        They're   coming  to
>because  my cats have  apparently  learned to type.        take me away, ha ha!

Regards, Frank


Tue, 11 May 2004 23:52:26 GMT  
 Assign file in DIR to string

Quote:

> Whoops,  thanks  i forgot about idio... um.. users.  Old habit
> syndrome strikes again. That's how we used to test in DOS. :-)
> Anyone saving a file with "." in the name, especially as a leading
> character would definitely not get much respect from me.

Anyone, such as the authors of Outlook Express?

 Volume in drive M is Q36 NTFS
 Volume Serial Number is 1CFF-CF0D

 Directory of D:\Home\Joe\Internet Stuff\Outlook Express

11/23/01  02:52p        <DIR>          .
11/23/01  02:52p        <DIR>          ..
10/09/01  10:46p                76,500 .dbx
11/17/01  02:32p               731,860 alt.comp.lang.visualbasic.ver.3.dbx
11/17/01  02:32p                     0 alt.comp.lang.visualbasic.ver3.dbx
11/17/01  02:32p               207,572 alt.comp.lang.visulabasic.ver3.dbx
11/17/01  02:32p            10,826,080 alt.horror.cthulhu.dbx
10/09/01  10:46p               666,324 alt.lang.basic.dbx
10/09/01  10:46p               142,036 alt.music.elastica.dbx
10/09/01  10:46p               207,572 alt.music.ministry.dbx

--
Joe Foster <mailto:jlfoster%40znet.com>     On the cans? <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Fri, 21 May 2004 09:58:29 GMT  
 Assign file in DIR to string
On Sun, 2 Dec 2001 17:58:29 -0800, "Joe \"Nuke Me Xemu\" Foster"

Quote:

>> Whoops,  thanks  i forgot about idio... um.. users.  Old habit
>> syndrome strikes again. That's how we used to test in DOS. :-)
>> Anyone saving a file with "." in the name, especially as a leading
>> character would definitely not get much respect from me.

>Anyone, such as the authors of Outlook Express?

ROFL, i rest my case. :-)

Regards, Frank



Fri, 21 May 2004 10:27:37 GMT  
 Assign file in DIR to string

Quote:

> On Sun, 2 Dec 2001 17:58:29 -0800, "Joe \"Nuke Me Xemu\" Foster"

> >> Whoops,  thanks  i forgot about idio... um.. users.  Old habit
> >> syndrome strikes again. That's how we used to test in DOS. :-)
> >> Anyone saving a file with "." in the name, especially as a leading
> >> character would definitely not get much respect from me.

> >Anyone, such as the authors of Outlook Express?

> ROFL, i rest my case. :-)

> Regards, Frank

LOL!

Yaniv.



Fri, 21 May 2004 14:43:08 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Assigning DIR results to an Array

2. Assigning DIR results to an Array

3. ASSIGN STRING NULL VALUE?

4. Assigning Null to a string type variable?

5. Assigning NULL to a string

6. Mac only: assign clipboard text to a string variable

7. URGENT: Error when assigning long strings to Form Fields in a protected Word document

8. Bolding some words within a string assigned to a variable

9. Why my string variable can't be assigned with a value

10. Assign a string value to an enum field

11. Assign a ListView Selection to a String?

12. Assigning function name to a string value

 

 
Powered by phpBB® Forum Software