Using custom dialgo boxes

C

cwhuse

I am running Word 2000 and am trying to design a document
that combines different paragraphs depending on different
choices and inputs by the user. To do that I'm trying to
create a custom dialog box that has text boxes and
different option boxes. I have been able to create the
custom dialog box as well as a macro that shows the
dialog box.

However, I can't figure out how to pass information that
the user inputs in the text boxes on the custom dialog
box to the macro that complies the document. Can anyone
help me?
 
J

Jonathan West

cwhuse said:
I am running Word 2000 and am trying to design a document
that combines different paragraphs depending on different
choices and inputs by the user. To do that I'm trying to
create a custom dialog box that has text boxes and
different option boxes. I have been able to create the
custom dialog box as well as a macro that shows the
dialog box.

However, I can't figure out how to pass information that
the user inputs in the text boxes on the custom dialog
box to the macro that complies the document. Can anyone
help me?

The most commaon way is to pass parameters in the call to the macro.

So if for instance, you have a macro that requires you to pass the contents
of two textboxes, you could have a macro that looks like this

Sub DoThis(foo as String, bar as String)
'your code goes here
End Sub

And then you can call this from the Click event of the OK button on your
form like this

Private Sub OKButton_Click()
DoThis foo:=TextBox1.Text, bar:=TextBox2.Text
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