HELP ME PLEASE

Author Message
joyedele

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 11/6/2006
  • Status: offline
HELP ME PLEASE Monday, November 06, 2006 5:11 AM (permalink)
0
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
 
#1
    ebgreen

    • Total Posts : 8227
    • Scores: 98
    • Reward points : 0
    • Joined: 7/12/2005
    • Status: offline
    RE: HELP ME PLEASE Monday, November 06, 2006 5:43 AM (permalink)
    0
    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
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • 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
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9