#1
|
|||
|
|||
Visual basic code for Word 2003 template
I am trying to help my daughter's preschool staff by creating a Word document template that will make an onerous administrative task quicker and easier.
I have discovered that to get the functionality we need, I have to create a userform with visual basic. Not being a developer, I have managed to get so far with it, but just can't work out how to get it to do the last step. Basically, I want it to: 1. as the user tabs into the form text field (bookmarked as Outcomes1), a list box (boxOutcomes1) pops up -- this much I can do 2. in the list box is a list of criteria that the staff member will select, using fmMultiSelectExtended -- this much I can do 3. after clicking the OK button on the pop up, the selected criteria will be inserted in the text field (Outcomes1) -- THIS I CAN NOT WORK OUT HOW TO DO!! Below is the code I have found works up to the point where I'm stuck. Is there anyone out here in internet-land that can help me finish this little project? Many, many thanks for any help. Even pointing me to another forum that can help would be appreciated. Code:
Private Sub boxOutcomes1_Change() ActiveDocument.FormFields("Outcomes1").Result = boxOutcomes1.Text End Sub Private Sub UserForm_Initialize() boxOutcomes1.List = Array("a. Separates and settles well;", "g. Openly expresses feelings;", "h. Cooperates with others;", "i. Is learning to negotiate;", "j. Makes predicted transitions smoothly;", "k. Is open to new challenges and discoveries;", "l. Celebrates and shares their contributions and achievements;", "m. Identifies and writes own name;") End Sub Last edited by macropod; 09-07-2012 at 09:33 PM. Reason: Added code tags |
#2
|
|||
|
|||
I'm not sure you need a userform, but these are very useful when needed. See Create and employ a Userform
I would think a typical fill-in form (not a userform but a document template) with a checklist might do what you need, even if not being as elegant. You would use formfields under the forms toolbar and protect the template for forms. See Please Fill Out This Form. |
#3
|
|||
|
|||
Thanks for that reply, however I have referred to the first page you suggested previously. It was some help.
I ended up going with a userform because of the number of characters I needed in the responses to choose from. I'm having trouble connecting to the other link you provided. |
#4
|
|||
|
|||
Please add a links to the cross posts that you have made in other forums.
|
#5
|
|||
|
|||
My apologies, I didn't realise these forums "crossed over" so to speak.
http://answers.microsoft.com/en-us/o...af97fd7?page=1 I have been making progress with the excellent help I have received at the other thread. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word Visual Basic error - run time error 504 | crazymorton | Word | 11 | 01-13-2012 04:32 AM |
Visual Basic Editor changes from 2003 to 2007 | Rockitman31 | Word VBA | 4 | 09-21-2011 12:01 PM |
Word Basic 2003 to Word Basic 2007 Incompatibility | Mark1110 | Word VBA | 1 | 12-29-2010 11:04 PM |
Referencing Tables in Visual Basic Editor | DavidB | Word Tables | 0 | 09-21-2009 04:01 PM |
A little Visual Basic Help Please | leroytrolley | Excel | 4 | 08-22-2008 03:57 AM |