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

VBScript to ListFiles in a folder output to msgbox 1

Status
Not open for further replies.

Serated

MIS
Aug 17, 2009
10
NZ
Hi,

What i am trying to achieve is to list all files older than 24hrs and have the output to a msgbox.

I am using filesystemobject with loop but this just gives me msbox after msgbox, I need all files to appear on 1 msgbox.

Help would be much appreciated.
Oh yes! I am just a beginner :)
Regards
 
Build up a string of the filenames in the loop, then display the string after all the files have been inspected.

Here's some psuedocode:
Code:
For each file in folder
strMessage = strMessage & file.name & vbcrlf
next
msgbox(strMessage)
 
Could you point me into a direction how to get the result from strMessage into html table. What i am trying achieve is mailing the list of files. I have everything in place but would just like to make it more presentable as the way i am now dumping it on the cdo.message HTMLBody.
 
If you want a single column table, you could modify the code to output something like this:

Code:
strMessage = "<table>"
For each file in folder
strMessage = strMessage & "<tr><td>" & file.name & "</td></tr>" 
next
strMessage = strMessage & "</table>"
msgbox(strMessage)
 
ur good, so to add another column would u just build another <td> node into strMessage

 
add another column
strMessage = strMessage & "<tr><td>" & file.name & "</td>[!]<td>Another column></td>[/!]</tr>"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top