|
-
Sep 23rd, 2005, 02:40 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Need suggestion
I am getting items from sent items in outlook in this format:
To Subject Sent Date
I am able to retrieve these bur how or where shouls i placed them?
I have placed them in a list box but then they do not appear one below the other.. I hope ur getting me. What should i use? Also i want to select items from this list....
Code:
lstsentitems.AddItem Sentmail.To & " " & Sentmail.Subject & " " & Sentmail.SentOn
I have written this code which just retrieving values an placing them in a list box..
-
Sep 23rd, 2005, 08:16 AM
#2
Re: Need suggestion
Drop them into an array. Make your list box return a list showing date/subject.
On click of an item in the list box, use the listindex to find the relevant index in the array and display the other fields onto labels/text boxes under the list.
just one option.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Sep 23rd, 2005, 08:34 AM
#3
Re: Need suggestion
This will place them one below each other...
VB Code:
lstsentitems.AddItem Sentmail.To
lstsentitems.AddItem Sentmail.Subject
lstsentitems.AddItem Sentmail.SentOn
this will place them into columns
VB Code:
lstsentitems.AddItem Sentmail.To & ";" & Sentmail.Subject & ";" & Sentmail.SentOn
Your code will place them into one column and the scroll bar will be activated..
I personally would allow the list box to have three columns, setting the bound column to be 2 this way multiple mails can be added using the subject as the main identifier. When the user clicks on an item in the listbox the relevant information can be retrieved from the column to which it is placed (-1 as 0 bound).. For Example
VB Code:
Private Sub lstsentitems_Click()
txtTo.Value = lstsentitems.Column(0,lstsentitems.listindex) 'First Column
txtSubject.Value = lstsentitems.Column(1,lstsentitems.listindex) 'Second Column
txtSentOn.Value = lstsentitems.Column(2,lstsentitems.listindex) 'Third Column
End Sub
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Sep 23rd, 2005, 09:24 AM
#4
Thread Starter
Addicted Member
Re: Need suggestion
how will i devide listbox in 3 parts?
i want somthing like this :
[email protected] hi 21/2/1904
fdaf@jjhkskfsfsdf bye 54/90/9867
[email protected] hieeee 13/09/9876
-
Sep 23rd, 2005, 09:26 AM
#5
Thread Starter
Addicted Member
Re: Need suggestion
sorry !
It should not be like that
all to one below other, all subject one below other........
-
Sep 23rd, 2005, 09:34 AM
#6
Re: Need suggestion
Ok do you want the list box to look like..
Displayed - Columns
Hi - [email protected]|Hi|21/2/1904
Bye - fdaf@jjhkskfsfsdf,54/90/9867
hieeee - [email protected]|hieeee|13/09/9876
If so then set Column Count of Listbox to 3 and Bound Column to 2, then the column widths to "0cm;5cm; 0cm". And it will only show the subject message, but the remainder will be available like in the code in my previous post.
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Sep 26th, 2005, 02:46 AM
#7
Thread Starter
Addicted Member
Re: Need suggestion
I have tried the code given by u....
Code:
For Each Sentmail In oSentFolder.Items
Sentmail.To = lstsentitems.Columns(0, lstsentitems.ListIndex) 'First Column
Sentmail.Subject = lstsentitems.Columns(1, lstsentitems.ListIndex) 'Second Column
Sentmail.SentOn = lstsentitems.Columns(2, lstsentitems.ListIndex) 'Third Column
its giving error wrong number of argument or invalid property assignment if i say---- columns
and if i kept it like ---column then its saying method or data member not found.
-
Sep 26th, 2005, 07:59 AM
#8
Re: Need suggestion
Are you sure this is a list box??
Can't remember if the list box control in vb6 has a columns property, check on the properties of the list box for "Column Count".. If not there then we will have to use the array method.
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Sep 27th, 2005, 02:08 AM
#9
Thread Starter
Addicted Member
Re: Need suggestion
yes its a list box.
and it has a property called columns..
at design timr i have used property columns with value 3 (i.e. 3 columns)
-
Sep 28th, 2005, 07:51 AM
#10
Re: Need suggestion
Looking at it you have the syntax the wrong way round.. you are trying to assign the value of the column to the Sent Items..
VB Code:
For Each Sentmail In oSentFolder.Items
Sentmail.To = lstsentitems.Columns(0, lstsentitems.ListIndex) 'First Column
Sentmail.Subject = lstsentitems.Columns(1, lstsentitems.ListIndex) 'Second Column
Sentmail.SentOn = lstsentitems.Columns(2, lstsentitems.ListIndex) 'Third Column
Should be
VB Code:
For Each Sentmail In oSentFolder.Items
lstsentitems.Columns(0, lstsentitems.ListIndex) = Sentmail.To
lstsentitems.Columns(1, lstsentitems.ListIndex) = Sentmail.Subject
lstsentitems.Columns(2, lstsentitems.ListIndex) = Sentmail.SentOn
What I was showing you was how to empty the information into text boxes on a form from the relevant columns in the listbox, not how to populate the listbox's columns..
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Sep 29th, 2005, 06:06 AM
#11
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|