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?

Re: Using custom dialgo boxes by Jonathan

Jonathan
Fri Oct 15 15:50:17 CDT 2004


"cwhuse" <anonymous@discussions.microsoft.com> wrote in message
news:0bff01c4b2f0$e802cf90$a301280a@phx.gbl...
>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


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup