Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


HELP ME PLEASE

 
Logged in as: Guest
arrSession:exec spGetSession 2,7,39474
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> HELP ME PLEASE
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 HELP ME PLEASE - 11/6/2006 4:11:19 AM   
  joyedele

 

Posts: 1
Score: 0
Joined: 11/6/2006
Status: offline
I am trying to create a word template in which a user will be able to select items from a list box.  The selected items from the list box will then be sent to another list box via a command button.  However I am having problems saving the items in the second list box.  When ever i reopen the document, the second list box no longer contains the selected items.  Is there anyone out there who could help me out with this problem?  I think I need to use the Document_save event, however I am very new to vba and am not sure how to accompish this task.  I've attached the code that I have.  Thanks in advance.

Private Sub Document_New()
  PopulateListBoxes
 
  'Clears out second list for a new document
  lstbox2.Clear
End Sub

Private Sub Document_Open()
  PopulateListBoxes
End Sub

Private Sub cmdMovetoRight_Click()
 
  Dim i As Integer
 
  If lstbbox1.ListIndex = -1 Then Exit Sub
  For i = lstbox1.ListCount - 1 To 0 Step -1
      If lstbox1.Selected(i) = True Then
          lstbox2.AddItem lstbox1.List(i)
          lstbox1.RemoveItem i
      End If
  Next i
End Sub
Private Sub cmdMovetoLeft_Click()

  Dim i As Integer
      
      If lstbox.ListIndex = -1 Then Exit Sub
      For i = lstbox2.ListCount - 1 To 0 Step -1
          If lstbox2.Selected(i) = True Then
              lstbox1.AddItem lstbox2.List(i)
              lstbbox2.RemoveItem i
          End If
      Next i
End Sub
 
 
Post #: 1
 
 RE: HELP ME PLEASE - 11/6/2006 4:43:06 AM   
  ebgreen


Posts: 4595
Score: 29
Joined: 7/12/2005
Status: offline
This is a VBS forum. There is a reasonably good chance of getting an answer here but you would probably get a faster response at a VBA forum.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to joyedele)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> HELP ME PLEASE Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts