macro questions

C

Chris

I am trying to open multiple input boxes when the word doc
is opened, then use the input from the boxes to place text
in the document. I can do this with one box using this
code:
Private Sub document_open()
Dim Message, Title, Default, MyValue
Message = "Please enter the number of Points for this
loan" ' Set prompt.
Title = "Enter Points" ' Set title.
Default = "0" ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)
End Sub

then i use the send and replace code to find the text and
replace it.

Basically i want to have users of the document be able to
answer simple questions and have the document be formatted
with their answers. Help Please.

thanks,

Chris
 
M

Mark Tangard

Chris,

This is a truly perfect textbook case for using a userform.
InputBoxes are fine for 1 or 2 questions, but they can get
profoundly annoying if there's a whole big parade of them.
Take a few minutes to run through Doug Robbins' userform
tutorial on the MVP site:

http://www.mvps.org/word/FAQs/Userforms/CreateAUserForm.htm

and see if all kinds of lightbulbs don't go off. With a
userform you can -- among a zillion other things -- combine
all of your user's answers on one comfortable dialog and
manipulate them easily and powerfully. As I say, this is
the perfect textbook case, and it's likely to addict you
pleasantly. ;)
 

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