How to add the data entered in a userform into a Text Form field

S

sujitg

Hi,
I am very new to VBA, and word macros ( learning with the help of this forum
and Diane Chapman's tutorials).

I created a userform and want to populate the contents of a text Form field
on the word form with data entered in the userform.

How do I do it?

Essentially how do I append the values to the textForm field from the
userform?

Plz let me know if I need to explain what I am trying to do mor eclearly,

Thanks for your help

Sujit
 
G

Greg Maxey

Using your excute command button, use code similiar to this:

Private Sub CommandButton1_Click()
Dim oFF As FormFields
Set oFF = ActiveDocument.FormFields
oFF("Text1").Result = Me.TextBox1.Text
oFF("Text2").Result = Me.TextBox2.Text
Unload Me
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top