Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-09-2014, 11:20 AM
marksm33 marksm33 is offline Moving Selected Items from a Multiselect Listbox on a userform to a bookmark in Word Windows 7 64bit Moving Selected Items from a Multiselect Listbox on a userform to a bookmark in Word Office 2013
Novice
Moving Selected Items from a Multiselect Listbox on a userform to a bookmark in Word
 
Join Date: Jan 2014
Posts: 12
marksm33 is on a distinguished road
Exclamation Moving Selected Items from a Multiselect Listbox on a userform to a bookmark in Word

I have a MS Word Document (Eval1.doc) where the user clicks on an ActiveX command button (Cmnd1a). This brings up a userform (UF1) with a multiselect listbox (LB1a) on it.

The user makes his/her selections, clicks the commandbutton (Cmnd1aa) beneath the listbox on the userform and the userform hides.



The user now sees the MS Word Document with the selected text inserted where Cmand1a used to be.

I can get this to work with a single selection listbox, but I am stuck when I change it to a multiselect listbox. I'm thinking it has something to do with setting up an array, but I need some help for someone to point me in the next direction. Here is the code that I've used so far along with a sample document.

In advance, THANKS

Code:
Option Explicit

Private Sub UserForm_Initialize()
Dim i, Str As String
Str = "Rating1,Rating2,Rating3,Rating4,"
For i = 0 To UBound(Split(Str, ","))
  LB1a.AddItem Split(Str, ",")(i)
Next
End Sub

Private Sub CommandButton1_Click()
Selection.Text = LB1a.Value
Application.ScreenRefresh
End Sub
Reply With Quote
 

Tags
listbox, multiselect, wordvba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving Selected Items from a Multiselect Listbox on a userform to a bookmark in Word Getting mult resps. selected in listbox to concatenate & paste at a bookmark in Word marksm33 Word VBA 3 01-15-2015 05:59 PM
How to use an ActiveX Control to insert a multi select listbox in Word marksm33 Word 2 01-29-2014 05:21 PM
Moving Selected Items from a Multiselect Listbox on a userform to a bookmark in Word How to link userform to another word document SaneMan Word VBA 5 10-14-2011 05:12 AM
[Word 2003] Macro's and a UserForm xanuex Word VBA 0 10-19-2009 05:42 AM
Moving Items windsurfer Outlook 0 12-06-2005 06:36 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:40 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft