Message Box

R

Rock

Draft 1

Sub MsgBoxmacro()
MsgBox "Question #1 here"
MsgBox "Question #2 here"
MsgBox "Question #3 here"
MsgBox "Question #4 here"
MsgBox "Question #5 here"
MsgBox "Question #6 here"
MsgBox "Question #7 here"
End Sub

Draft 2

Option Explicit

Sub MsgBoxmacro()
Dim ans1 As String
Dim BMs As Bookmarks
Dim rng As Word.Range

Set BMs = ActiveDocument.Bookmarks

ans1 = InputBox("Enter your first name", "Answer #1")
If Len(ans1) > 0 Then
Set rng = BMs("ans1").Range
rng.Text = ans1
Else: Exit Sub
End If

End Sub

I am looking for help with a macro because the macros I have so far are not
accomplishing my desired procedure. Can you help me? I have seven questions.
I would like to create a macro that when activated will perform the following
functions. Display 1st question in message box with field below it to give
the answer (ideally the empty field for the answer would be memo format but
not required). After the question has been answered I can click stop or
continue on the message box.

If I click continue the message box will disappear. The question will be
pasted in the word document one line below the first line with no text. The
answer will be pasted two lines below the recently pasted question, the
application will save itself, and a new message box (same format) will appear
with the 2nd question.

As long as I click continue on the message box the procedure will continue
to repeat itself with the 2nd, 3rd, 4th, 5th, 6th, 7th questions, and then
loop back to the 1st, 2nd, 3rd, etc questions until I select stop on the
message box.

If I click stop on the message box the message box will disappear. The
question will be pasted in the word document one line below the first line
with no text. The answer will be pasted two lines below the recently pasted
question, the application will be saved, and the program will stop running.

Can you help me with this?
 

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