From: Graham Mayor on 9 Mar 2010 02:02 Delete everything from the userform code area and replace it with Option Explicit Private Sub CommandButton1_Click() Dim oVars As Variables Set oVars = ActiveDocument.Variables oVars("varDoctor1").Value = Me.TextBox1.Value oVars("varDoctor2").Value = Me.TextBox2.Value oVars("varStreetAddress").Value = Me.TextBox3.Value oVars("varCityStateZip").Value = Me.TextBox4.Value oVars("varPatient").Value = Me.TextBox5.Value oVars("varAge").Value = Me.TextBox6.Value oVars("varRace").Value = Me.ListBox1.Value ActiveDocument.Fields.Update Unload Me End Sub Private Sub UserForm_Initialize() With Me.ListBox1 .AddItem "Hispanic-American" .AddItem "White" .AddItem "African-American" .AddItem "Asian" End With End Sub -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
First
|
Prev
|
Pages: 1 2 3 4 5 Prev: Bringing different windows to the front Next: Direct edit of Building Blocks |