The following macro will ask you how many students and for how many
questions you want to do this for and will then create that number of
scrambled documents. (Have fun unscrambling them to mark them)
Dim i As Integer, j As Integer, k As Integer, Source As Document, Target As
Document, students As Long, Questions as long
Dim Message, Title, question As Range
Message = "Enter number of students" ' Set prompt.
Title = "Randomizer" ' Set title.
' Display message, title
students = InputBox(Message, Title)
Message = "Enter number of questions to be scrambled" ' Set prompt.
Title = "Randomizer" ' Set title.
' Display message, title
Questions = InputBox(Message, Title)
For k = 1 To students
Set Source = Documents.Open("E:\Worddocs\source1.doc")
Set Target = Documents.Add
For i = Questions To 0 Step -1
j = Int((i * Rnd) + 1)
Set question = Source.Paragraphs(j).Range
Target.Range.InsertAfter question
question.Delete
Next i
' Print and Close Document with random list of questions
Target.PrintOut
' Target.SaveAs ("E:\worddocs\student" & k & ".doc")
Target.Close SaveChanges:=wdDoNotSaveChanges
Source.Close SaveChanges:=wdDoNotSaveChanges
Next k
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP