A Microsoft Word forum. Microsoft Office Word Forum - WordBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Microsoft Office Word Forum - WordBanter forum » Microsoft Word Newsgroups » Formatting Long Documents
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Macro to edit test questions

Thread Tools Display Modes
Old August 20th 16, 12:55 AM
schwa schwa is offline
Junior Member
First recorded activity by WordBanter: Aug 2016
Posts: 1
Default Macro to edit test questions

Hi, I'm using a macro to edit a lot of test questions, Iím just showing two of them here as an example.
1- Paul found it much easier to use a pencil for taking notes
as he could .......... mistakes, which he made plenty of, very easily.
A) type B) erase C) deter
D) furnish E) release
2- You have to watch that market trader very ...........;
otherwise, he will sneakily throw a few rotten oranges in
amongst the good ones.
A) closely B) secretly C) violently
D) daringly E) placidly

Sub root()
Selection.GoTo What:=wdGoToHeading, Which:=wdGoToFirst
With Selection.Find
.Text = "A)"
.Forward = True
'.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Do While Selection.Find.Execute
If Selection.Find.Found = True Then
Selection.MoveUp Unit:=wdParagraph, Count:=3, Extend:=wdExtend
Selection.Font.Bold = wdToggle
Selection.MoveDown Unit:=wdParagraph, Count:=2
End If
End Sub

Now, with this macro, I can turn the font of the question into bold, but the problem is that the macro above can not apply to every question because the number of lines may be different in every question so the values in the micro above (Count:=3 and Count:=2) should be changed or is there any universal way for this?

I want that macro to turn the question into a SINGLE PARAGRAPH, for which Iím currently using a separate macro:

Sub testnew()
' testnew Makro
Selection.HomeKey Unit:=wdLine
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.TypeText Text:=" "
End Sub

I want to merge the two macros, if possible.
Sorry for the long post, and thank you for your attention

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions to expect on Word assessment test Richard Champlin Microsoft Word Help 1 March 19th 08 03:17 PM
change test questions to reverse order Dave R. Microsoft Word Help 5 August 27th 06 09:11 AM
scramble the questions,on a test and create another version torrence Microsoft Word Help 1 March 6th 06 11:13 PM
Sequentially numbering multiple-choice test questions? tgocean Microsoft Word Help 4 September 20th 05 05:37 AM
Quick way to rearrange test questions in Word lkr6104r Page Layout 5 April 11th 05 12:29 PM

All times are GMT +1. The time now is 01:56 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright ©2004-2018 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.