View Full Version : Table help please
ianhull
10-04-2004, 02:24 PM
Hi all,
I would like to have a table which lists all the .xls files in one directory but I don't know where to start.
Can anyone help me out with a sample?
It would be very much appreciated.
Also does anyone know how to email an attachment from within AMS or via asp/php?
thanks in advance.
Ian
yosik
10-04-2004, 03:34 PM
Very simple, you use the File.Find action which returns a table, as follows:
myTable = File.Find( _SourceFolder, "*.xls", true, false);
Good luck,
Yossi
ianhull
10-04-2004, 04:38 PM
Thanks Yossi,
Do you know how I would get Source_Drive\Program Files\ My dir?
Also. Is my table made from a ListBox?
I have ListBox1 = File.Find( _SourceFolder, "*.xls", true, false);
I am not very good at all this and I appreciate your help.
Regards
Ian
ianhull
10-04-2004, 04:54 PM
I have managed to list all the files in one directory but I would like to be able to click on the given filename and open it in its default program.
Can anyone help me achieve this?
Thanks in advance.
Ian
ianhull
10-04-2004, 05:23 PM
Hi All,
again, I have managed to display all the .xls files in a listbox object but I would like to beable to highlight the filename and click an open button to open the file.
Can anyone please help me achieve this?
Thanks
sside
10-04-2004, 05:47 PM
Hallo ianhull
Let's assume that you have managed to load the files into a listbox object. Let's assume that the files loaded into listbox object are the paths to these files.
This is the code you need to open these files. You can place the code at the On Dubbel-Click event of the listbox object or at the On-Click event of a button.
result = ListBox.GetSelected("ListBox1");
result2 = ListBox.GetItemText("ListBox1", result[1]);
File.Open(result2, "", SW_SHOWNORMAL);
Sside
sside
10-04-2004, 05:57 PM
Here you have a little example the way i understand it.
You must double click it to open it (the excel file)
ianhull
10-04-2004, 06:54 PM
Hey thanks for the sside!!!!.
Very much appreciated.
One other thing though. Can you help me to set it up so that it looks in _Sourcedrive\\MyFolder?
Thanks for your time.
regards Ian
sside
10-04-2004, 07:07 PM
File.Open(_SourceDrive.."\\MyFolder\\MyText.txt", "", SW_SHOWNORMAL);
TJ_Tigger
10-04-2004, 07:39 PM
Here is another project. I have tried to comment the text to help in learning how to work with Tables and listbox items. There are two buttons for adding items to the listbox, one uses a static path and the other allows the user to select the folder where the files exist.
Tigg
ianhull
10-04-2004, 11:04 PM
Thanks TJ.
Much appreciated. :)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.