Moving Data Between List Boxes
Hi, I need a little help if anyone has a moment. I have 2 list boxes one called lstSource and the other is lstDestination. I have it set up and working so that I can multi select rows in my source and move them into my value list in my destination list box. I call the function in the click even of a right arrow button. This works great.
Now I want the user to be able to remove fields from the lstDestination in case they make a mistake or change their mind. I want to do this using a left arrow button but I can't quite get the code working properly. I have gotten it to do everything butx but....however, I can't get it to just delete the selected row(s). Here is my code that is working to move my rows from my lstSource to my lstDestination. I assume it must be some variation of this....
<vb code> Private Sub cmdCopyItem_Click() CopySelected Me End Sub
Function CopySelected(frm As Form) As Integer Dim ctlSource As Control Dim ctlDest As Control Dim strItems As String Dim intCurrentRow As Integer Set ctlSource = frm!lstSource Set ctlDest = frm!lstDestination For intCurrentRow = 0 To ctlSource.ListCount - 1 If ctlSource.Selected(intCurrentRow) Then strItems = strItems & ctlSource.Column(0, _ intCurrentRow) & ";" End If Next intCurrentRow ' Reset destination control's RowSource property. ctlDest.RowSource = "" ctlDest.RowSource = strItems End Function </vb code>
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Moving Item Between List Boxes
I have a command button with the Caption ">". When clicked I want the selection the user has made in ListBox1 to be moved to ListBox2.
Anyone ever do something like this before?
thx..
Manipulating Data In List Boxes
Let's say that I have 3 list boxes. The first list box is called lstSelling and is populated with data of different selling prices of stocks.
The second list box is called lstBuying and is populated with data of different buying prices of stocks.
I need to determine the profit/loss of the stocks and have the corresponding profit/loss display in a third list box named lstProfit.
I know that profit would be calculatd as selling - buying price but I am not too sure how to code it.
I was thinking
lstSelling.listindex(0) - lstBuying.ListIndex(0) = lstProfit.ListIndex(0)
would this diplsy the profit in lstProfit? I am confused and any help would be greatly appreciated.
Data Bases & List Boxes
How do i load a database item into a lstBox then copy the value of that lstBox into a separate txtBox?
Comparing Data In List Boxes
I have two list boxes on my main form. One populates from an Access database the other from a web site. After a bit of fiddling and a lot of reading (First try at ADO) I have this part working just fine. My problem is this. Once the 2 list boxes are populated I want to compare the two and remove the entries from the database list that appear on the website list. I hope that is clear. There is a slight added complication, the database contains a full name and a short name, the short name is how it is listed on the website, I populate the list box with the full name to make it easier for the user to read.
I have read and used the code from the ADO tutorial on this site, so I have loaded the records into variables and closed the connection. I am having problems comparing the two lists and removing the data from lstSponsors that appears in lstMySponsors. I have bolded the section that I KNOW is wrong, I am just lost as to what it is I should be doing here.
Code:
Option Explicit
Dim MyConn As ADODB.Connection
Dim MyRecSet As ADODB.Recordset
Dim strOptionID As String, strSponsor As String, strSponsorShort As String
Private Sub Form_Load()
Set MyConn = New ADODB.Connection
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:sponsorsnew.mdb;"
MyConn.Open
Set MyRecSet = MyConn.Execute("SELECT optionID, sponsor, sponsorShort FROM sponsors")
Do Until MyRecSet.EOF
strOptionID = MyRecSet.Fields.Item("optionID").Value
strSponsor = MyRecSet.Fields.Item("sponsor").Value
strSponsorShort = MyRecSet.Fields.Item("sponsorShort").Value
lstSponsors.AddItem strSponsor
MyRecSet.MoveNext
Loop
MyConn.Close
End Sub
Private Sub cmdLogin_Click()
GoWinInet ("http://)
End Sub
Private Sub cmdUpdate_Click()
getSponsors
Pause (500)
checkSponsors
End Sub
[b]Private Sub checkSponsors()
Dim x As Integer
x = 0
Do Until x = lstMySponsors.ListCount
If lstMySponsors.DataField = strSponsorShort Then
lstSponsors.RemoveItem (lstMySponsors.DataField) 'I have a pretty good idea this line is the problem =/
x = x + 1
End If
Loop
[/b]
End Sub
Yes I know there is no URL, it was edited on purpose. The getSponsors is just a module that loads lstMySponsors from the website. Any help greatly appreciated.
Also I would like to sort the data by the optionID (a third field) NOT by the sponsor name which the list seems intent on doing. Even if I add the optionID to the list box is still sorts by the name, if I set the property of the listbox to sorted = true then it sorts by id but in the 1,10,100 format =/
Rick
Parsing Data From Two List Boxes
Hello,
I have two listboxes both containing dates. One list box has a list of complete dates from 11/11/2002 to 11/20/2002. The second listbox has only some of the dates in the same range, i.e. 11/12/2002, 11/15/2002 and 11/16/2002. I would like to be able to take the dates from the first listbox, that do not appear in the second listbox and display them in a third listbox. Does anyone have an idea as to how this might be done?? I've been trying and just can't seem to pulli ti together.
Trouble With Retrieving Data From List Boxes
i have a list box in my program, and when you double click on one of the entries in it i want to change the current directory based on what the contents of the list box entry is.
trouble is, when i double click on any one of them, it changes the current drive to A:, which is the first entry in the list.
here is something like my code:
Code:
Private Sub LstDrives_Click()
ChDrive lstDrives.list(index)
debug.print lstDrives.listindex
debug.print lstDrives.list(Index)
End Sub
it prints the correct index that the user clicks on, but always prints A: and changes the drive to A:, nomatter which drive you click on.
am i doing something wrong? can this be done? is there a better object that i should be using to store the list of drives in (please not the drivelistbox, i really dont want to use that because it isnt suitable).
thanks
all help appreciated.
Reading Data From A Single File To Two List Boxes
hi,
i an trying to copy text from a file into two list boxes. all the data is stored in one file and is stored as such
car.gif,lambo,italy
por.gif,Porche,Germany
what i want to do is seperate the data and use only the last two items to input them into list boxes.
one for car type and one for country of origin.
all data will be loaded at form load and the gif is randomized. the items are entered into an array and when the user enters the correct choice of country and car type they are given a point.
can any one please help??
thanks
wullb
Sorting Data In List Boxes A Run Time - RESOLVED
I know that you can get a list box to automatically sort data as it is entered into a list box a design time. But i need to sort the data at run time when a user clicks on a button.
So far I have got:
lstPlayList.sorted = true
But this doesn't work. Can anyone help me?
Thanks
Web Control, List Boxes, Text Boxes, Please Help This Is Winding Me Up!
Hi guys i need some help with the webcontrol function in VB6
Part of my program needs to put listbox data from the program into a text box on the web and then click a submit button...
The list box i have has a list of multiple directories in (for the location of my files), from there i just want the program to put the top directory of the list box into a text box on the web and click a submit button on the web (its for uploading a queue of files), then after that has finished uploading, do the next directory in the list box... etc
It sounds pretty simple but i have no idea how to do it...
Thanks for any help you can give me, i will write a really good review about you and good rating etc.
Any knowledge of this would be greatly appreciated
thanks a bunch
toodle pipples
Alex
Combo And List Boxes To Text Boxes?
Connecting sub-menus to rich text boxes is fine is most cases but the user does not always want to use menus to load and display text. Applying the same technique as sub menus to text boxes with combo or list boxes just wont work could someone please help me out with this one.
Both combo and list boxes will for example:
Contain an alphabetic list.
When the user clicks on a file it should locate the text file from the drive.
It should then open it into a rich text box on the same form.
Could this be possible?
Please any help will greatly be appreciated.
Help With File List , Dir List And Drive List Boxes..
How do i link my drive list , file list and dir list boxes to gether , so that when i for exaple set the drive list to c: , the dir list will then give all dir in there, and file list will show me files from the directory, right now the default file list is set to my vb file list and i cant change it...
Moving Dialog Boxes
Hi,
Is there any method to set the locations of the Dialog boxex ?
We can give the location of the "Windows", "Forms" by using Move or MoveWindow(API) methods. Like that can we locate the "Dialog" boxs...?
I think this can do bcos Microsoft applications has this kind of Dialog boxes and they are showing in correct locations of the screen
How can i do this...? Pls help me find out
Moving Picture Boxes
I am making a soccer shoot-out game and i want to move the soccerball (the Picture Box) to where the player selects eg. top right, top left, top centre, bottom right, bottom left, bottom centre. If someone could please help me with this code it would be much appreciated
Moving Text Boxes
Hiii,
I need to move a text box to the mouse point. How can I move. How can I get the mouse location.
Thanks
Sam
Moving Boxes With Loops
Private Sub cmdleft_Click()
Loop
frmloop.Left = frmloop - 1
Do Until frmloop.Left = 2
End Sub
Private Sub cmdright_Click()
frmloop.Left = frmloop + 1
End Sub
Private Sub cmdup_Click()
frmloop.Top = frmloop - 1
End Sub
Private Sub Cmddown_Click()
frmloop.Top = frmloop - 1
End Sub
Private Sub Command6_Click()
Unload Me
End Sub
It keeps saying I have a loop without a do in the first cmd. THE DO is there. Why doesn't it like me.
Moving Picture Boxes
Does anybody know how to move a picture boxe across the screen within a visual basic form.
LIST BOX HELL. Please Save, Remove Items, Many List Boxes...one Last Name
ok, so the code so far, or as much as you need to see, is
****************************
***************************
***************************
***************************
***************************
Sub LoadCal()
Dim gdtDate As Date
Dim i As Integer
Dim x As Integer
Dim startDay As Integer
Dim giMaxDays As Integer
' clear list boxes before filling again
For i = 0 To 41
List1(i).Clear
Next
' * * * * * * * * * * * * * * * * * * * * * *
' * * * * * ADD DAY NUMBERS * * * * *
'label at top of form
Label1.Caption = MonthName(giMonth) & " " & giYear
'this is the current date
gdtDate = CDate(giMonth & "/01/" & giYear)
'minus one so the first line is never completely empty
startDay = Weekday(gdtDate) - 1
'the number of days in this month
giMaxDays = Day(DateAdd("m", 1, gdtDate) - 1)
'populates list boxes with days
x = 1
i = startDay
While i < (giMaxDays + startDay)
List1(i).AddItem (x)
x = x + 1
i = i + 1
Wend
' * * * * * * * * * * * * * * * * * * * * * *
' * * * * * ADD NAMES TO DAYS * * * * *
' !!!!!!!!!!!!!!!!!check to see that list is not empty !!!!!!!!!!!
If lstAgentList.ListCount = 0 Then GoTo done
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'agent list counter, "at which item" index
x = -1
'populate list boxes from the first day of the month with numbers
i = startDay
'counter for number of days until sunday
a = startDay - 1
'from the first day to the last day
While i < (giMaxDays + startDay)
If a < 6 Then
'a maximum of 3 names per day
While (List1(i).ListCount) < 4
' if there are no more items in the items list ('x' is greater than counter)
If x < (lstAgentList.ListCount - 1) Then
x = x + 1
' otherwise set it back to 0 (zero)
Else
x = 0
End If
'add the next name from the established agent list
List1(i).AddItem (lstAgentList.List(x))
Wend
a = a + 1
Else
'a maximum of 3 names per day
While (List1(i).ListCount) < 4
'add the next name from the established agent list
List1(i).AddItem (lstAgentList.List(x))
'here we do not increment name for it is a sunday
Wend
'reset 7 days until sunday counter
a = 0
End If
'increment day count
i = i + 1
Wend
done:
' end
End Sub
***************************
***************************
***************************
***************************
now see the shaddy thing with this is...well, it's a calendar month see, and every day is a list box....first item, the date, 1st, 2nd, 3rd, 4th, and so on...each list box can hold that first item, the date, plus 3 names.
if someone double clicks on one of those names (which are populated through other methods...not important) i want that name to be deleted...now where i am out of ideas is: how do i delete one item from one list when my list (List1) is an array of about 41 list boxes all named List1 (x) see....
also if I wanted that name which was double click to delete itself through the entire month, then ....well...the rest is my own trouble...but so far i can't seem to be able to delete.
grrr.
...
thanks in advance,
-munchkin
Moving Multiple Picture Boxes - Lag?
On my form I have a control array of 239 picture boxes NOT being moved. Then I create 5 picture boxes of a new control array and move them with a timer with the interval set to 10. It moves fine, but when I load another 5 picture boxes totaling 10 the game starts to lag by the images starting to move slower then set to. The more I load and more the slower it keeps getting.
I am increasing the .top of all of the picture boxes by 25 every time the timer ticks with a 10 interval.
How can I prevent this 'lag'?
Problem Moving Between Text Boxes
Hi all,
I have a Form with two text boxes. All the controls have the VB assigned default names. Basically I want the user to enter the data before he leaves the text box to the next one, by pressing tab or using the mouse. So I tried using the following code ..
Private Sub Text1_LostFocus()
If (Text1.Text = "") Then
MsgBox ("TextBox 1 is empty please reenter ")
End If
Text1.SetFocus
End Sub
Private Sub Text2_LostFocus()
If (Text2.Text = "") Then
MsgBox ("TextBox 2 is empty please reenter ")
End If
Text2.SetFocus
End Sub
The problem is that if I move from Textbox1 to Textbox2 by pressing Tab, I get the Msgbox saying "Text Box1 is Emtpy" , but when I click Ok, the control returns back to Text1, but in the process it triggers the lost focus event of Text2 so I get the message "Text box 2 empty" and this messages cycle on for ever, and I end up killing my application. Can anyone suggest a way to avoid this problem ?
Thank You
Senthil
Problem Moving Between Text Boxes
Hi all,
I have a Form with two text boxes. All the controls have the VB assigned default names. Basically I want the user to enter the data before he leaves the text box to the next one, by pressing tab or using the mouse. So I tried using the following code ..
Code:
Private Sub Text1_LostFocus()
If (Text1.Text = "") Then
MsgBox ("TextBox 1 is empty please reenter ")
End If
Text1.SetFocus
End Sub
Private Sub Text2_LostFocus()
If (Text2.Text = "") Then
MsgBox ("TextBox 2 is empty please reenter ")
End If
Text2.SetFocus
End Sub
The problem is that if I move from Textbox1 to Textbox2 by pressing Tab, I get the Msgbox saying "Text Box1 is Emtpy" , but when I click Ok, the control returns back to Text1, but in the process it triggers the lost focus event of Text2 so I get the message "Text box 2 empty" and this messages cycle on for ever, and I end up killing my application. Can anyone suggest a way to avoid this problem ?
Thank You
Senthil
Edited by - IDontKnow on 8/10/2004 9:31:36 PM
Moving Picture Boxes W/ Keyboard
is there a way to be able to move picture boxes using the keyboad? i.e picturebox1 moves up using the caps lock key, and down by using the shift key. picturbox2 moves up using the plus sign(the one all the way to the right of the keyboard no the one above the equal sign) and moves down by hitting the enter key(under the plus sign).thnx in advance for any help.
Moving Arround A Control Array Of Txt Boxes
hi could any body tell me how i can use the arrow keys to move between txtboxes in a control array i have 41 txtboxes in the form of 7 columns by 6 rows.
the code i came up with as an idea was:
Code:
Dim iLoc As Integer
txtPuz(Index) = iLoc
If KeyCode = vbKeyUp Then
If iLoc > 6 Then
iLoc = iLoc - 7
txtPuz(iLoc).SetFocus
End If
End If
If KeyCode = vbKeyDown Then
If iLoc < 35 Then
iLoc = iLoc + 7
txtPuz(iLoc).SetFocus
End If
End If
It didnt work properly when set to the forms keydown event. so what code would be best and where would i put the code?
Thanks
Combo Boxes Or List Boxes?????
A bit of a beginners question. Hope it makes sense
I dont know which is the best to use. Here is the problem:
I want some kind of drop down list that allows the user to pick one of 12 items. Then that item is linked to a set of numbers. For e.g. if user chooses the item "A" then this means the numbers 0.025689 and 0.85696 is linked to each. Now do i use a combo or a list item or something else.
In addition what kind of code do you use to enter new items in a combo box or list item box. I tried to use:
ComboBox1.AddItem "A"
ComboBox1.AddItem "B"
within the combo box private sub - but when i play it back the combo box is empty. Any ideas???
Thanks
List Boxes And Text Boxes
Ok i have a list box that has a list of movies to choose from then you choose how many tickets you want i want to know how to display them in a text box and how to clear the dat file that i saved it in
List Boxes And Text Boxes
I have a list box with a bunch of items in it. I'm trying to make it so that when you click on an item in a list, the text appears in a text box. I don't know too much.. but what I have so far is
Private Sub List1_Click()
Dim i As Integer
Text1.Text = List1.List(i)
End Sub
What this does is when I click an item, it makes the text of the textbox the first item in the list. How do I change it so that I can pick an item from the list and have the text of that item displayed in the text box? Thanks in advance!
List Boxes = Text Boxes
Hi I'm new here (and to VB). I'm using VB in Excel and trying to get a list box to write to a series of three text boxes. I have a mobile phone user form and the list box has a selection of phones in it. I want the user to be able to choose three phones from the same list box and have the results display - one in each box. Can I do this and, if so, how?
DataList Boxes Vs. List Boxes
OK - I currently have a DataList box which displays all of my records using the "List Field" Property. I need to enable a multiselect feature though. So I decided to use the REGULAR List Box, since it has a multiselect property. Yet, I cant seem to get the list box to have all of the records in there (or any of them for that matter). Is there a similar property in regular list boxes like the "List Field" Property, or is there a similar property in DataList Boxes which can enable multiselect?
Someone help!
Drive List And Directory List Boxes
I have one drive list box and one directory list box in my program.
When I run my program I can see all Local and Mapped network drives.
But I need to add the Network Neighborhood in the Drive list box.
I need to be able to see all servers and drives on the network. Can anyone tell me how to do this? Thanks!
Drive List And Directory List Boxes
I have one drive list box and one directory list box in my program.
When I run my program I can see all Local and Mapped network drives.
But I need to add the Network Neighborhood in the Drive list box.
I need to be able to see all servers and drives on the network. Can anyone tell me how to do this? Thanks!
Moving Already Created And Configured Controls Into Frames/picture Boxes
I'm sure there is a simple way of doing this or a quick fix, but I'm currently struggling. I've made and coded for some controls (pictureboxes that move accross the screen).
However, I now want them to only be visible inside a picture box I have just created. But when run the image just moves behind it. I'm using sprites and the BitBLT method to draw and move my object.
Any suggestions appreciated.
Thanks
Moving Mouse Over The List Box
Hi, I am trying to manually make my own Menu Editor. I don't like how you cannot edit the font and color of the regular menu editor.I got it all working and looking great, but there are 2 small problems that I cannot figure out how to fix.
I want to be able to move the mouse over a list box, and just like a regular menu I want the one that is under the mouse to be highlighted. And as you move the mouse over different selections it will highlight them, without yet clicking on the mouse, anyone know how to do that?
Also, does anyone know how to change the forecolor of a command button? It is possible?
I appreciate any help.
Thanks,
Dan
Moving Items To The End Of The List!
hi!all!
i am looking for a code to move a selected item to the end of the list box!
for example i have a list1 with items
1
2
3
i select the first item ,item 1 and then click the button!
the item should move to the end of the list and the list would look like>
2
3
1
---------------------------
Moving Items Up And Down In A List Box...
Hey guys, I was wondering if anyone can help me on how to move items up and down a list box? Also, if I want to move an item start from the bottom to the top?
Please, help me...
Moving Items Around A List Box
hi !
I have yet another short query here..and would be grateful if anyone could help.
I got a list box with a playlist for a radio show..and to the right of it i have 2 more listboxes..one with duration of track and the other with the point in time at which the track starts in the show.
I have 2 buttons below up and down which when clicked on move the selected item up or down in the playlist accordingly along with the related times.
How do i do this ?
Also how do make sure that there is one item selected at aLL times.
any help would be great !
Harpooon
Moving Up && Down In File List Box
heyy guyz..
i was wondering...if i have a file list box with many files in it...how can i cause the cursor or watever to move to the next file down or up, to the beginning, and to the end of the list of files (and if possible cause the cursor to move randomly as well)...
and if it does move...under which event would that be?? example: file1_change??
thanxx in advance
Moving Lines Within A List Box
hello,
i have a list box and i want to move some lines in it, but here is the catch;
i built the list like this:
i have a 'brake' line and then some other lines starting with " " (4 spaces). it serves me as groups.
what i want to do is move the entire groups up and down.
i keep failing on managing to do this..
it looks something like this:
brake1
line1
line2
line3
brake2
line1
brake3
line1
line2
i have between 2 and 10 brakes and as many lines between them.. (they also have unique names; not 'brake' and 'line').
also,
the up and down buttons are only enabled when i'm on a brake.
they are disabled seperatly when i'm on the first or last brake.
when i click on my up button (for example when i'm on brake3);
it will replace brake2 and look like this:
brake1
line1
line2
line3
brake3
line1
line2
brake2
line1
and so is with the down button (on brake1);
brake3
line1
line2
brake1
line1
line2
line3
brake2
line1
after this, i also want to be able to move the lines up and down, but to disable the buttons when i'm on the first line and the last line.
(i only use 2 buttons; 'CmdUp' and 'CmdDown')
i use this line to tell when it's a line and not a brake;
if left$(list1.listindex,4)=" " then blahblah..
i only managed to get the brake (any) to become the first of the list, and not even go down...
help?
thanks in advance..
Moving All Items From One List Box To Another
I am having problems selecting the first item in the list box. Here is the code that I have written:
Private Sub ZonesAll_Click()
Dim ZoneName As String
Dim ZoneNumber As Integer
Dim n As Integer
Dim i As Integer
n = Me.ZonesNotSelected.ListCount
'I need a line here that will select the top item in the list
For i = 0 To n - 1
Me.ZonesNotSelected.Selected
ZoneName = Me.ZonesNotSelected.Text
ZoneNumber = Me.ZonesNotSelected.ListIndex
Me.ZonesNotSelected.RemoveItem ZoneNumber
Me.ZonesSelected.AddItem ZoneName
Next i
End Sub
Thanks
SLR
Moving List Items Up And Down
This is a bit foolish question bu I forgot how to do it.
I want to move items listed in the list box up or down. How do I do it?
Kinjal
Moving Items Up/Down In List Box W/VB
There is another thread in the javascript section with almost the same title, so what I am wondering is if there is a VB version of it. The thread id is
URL
Any help would be greatly appreciated
Moving List (TreeView VB6)
Hey,
I have a list, and I was wondering if there was a way to move an item e.g. from 3 > 4 or 4 < 3 by clicking on a command button? Also if you can drag and drop them to the position that you want them to be in?
Thank You
Moving A Item In A List Box Up Or Down
I have two buttons on a form and I want the be able to click the up button then move the selected item up or click the down button and have the item go down.
Any Ideas?
DBGrid, Bound Data, Moving Rows Does Not Update Data Proper
I am using the standard data control along with a DBgrid, I also have text boxes with some of the same data as the dbgrid.
I have the DBGrid and the recordset that populates the DBGrid
and the text boxes bound.
When I change rows in the dbgrid the data changes in the text boxes as I expected but I am also doing a "record number of number of records".
As well as some other stuff similar to the record counts.
Anyway all the text boxes update when I change rows in the DBGrid
but the other stuff does not update proper.
Strange though if I click on say the third line down on the dbgrid
everything updates but the record counter. Then if I click on say the
fifth line down the text boxes update with the correct data but the
record counter will then say record 3 of xx records. Then if I click on
say the 1st line everything updates proper except the record counter.
It will now say record 5 of xx records. Well by now you get the picture the other stuff lags behind by one row click.
I have tried
Private Sub DBgrid1_click()
data.recordset.refresh
End Sub
I also tried
Private Sub DBgrid1_click()
data.recordset.movenext
data.recordset.moveprevious
End Sub
Still doesn't work?????????
Any suggestion would be helpful.
Moving Through The Files In A File List Box...
Hey everyone,
As the title states I am trying to move through files in a file list box. For example...if the file list box contains 3 files and the user selects all 3 and clicks on a delete button, a loop will be activated like below that will update the selected index and call the delete confirmation each time. The problem is I don't know how to get the selected index to change. I have tried filelistbox1.selectedindex.equals(count) but the selected index never changes from 0. If this isn't clear post back and I'll try to explain it better...any help would be greatly appreciated. Thanks in advance
Code:Dim count As Integer = 0
Do Until count = FileListBox1.SelectedItems.Count
'update selected index so when frmdelete is called it uses the right filename
frmdelete.show
count = count + 1
Loop
Edited by - piles on 6/20/2007 8:10:01 AM
Searching For And Moving E-mails In An Outlook PST From A List In Excel Using VBA
Hi there,
I was hoping someone might be able to give me some guidance - I have the task of sorting various e-mails in a master PST, into seperate folders based on a list of e-mail addresses which have been extracted from the PST, and are stored as a simple Excel workbook.
the current list of addresses reaches around 5000 items, and so doing this manually would be a extremely burdensom task - I was hoping that this would made fairly simple by the use of a VBA marco, and it could be easily recorded however Outlook does not allow the recording of macros. I've also been reviewing various samples, but cannot make head nor tail of what needs to be done, and my experience with VBA is fairly limited.
Basically what needs to happen is:
- vba selects the e-mail address from a cell in Excel, and copies this value
- changes to Outlook, and performs a search on the Inbox for the copied value (e-mail adress) as the sender, and then moves any e-mail item found with this value to a seperate folder
- goes back to Excel, and repeats the process to select the next cell's value.
If anyone would be able to help or provide some guidance or sample code, it would be greatly appreciated!
Best regards,
Nick
|