P
Petra Liverani
Hi,
I have put together bits of code that will put a multiple select question into a particular format for loading online. Part of the code involves pasting the letter to the left of ~~~ against Answer=. Below is what the text looks like before and after. However, although I seem to have used the same code for a find loop that I've used elsewhere (I think it was Doug Robins who provided it for me) it does absolutely nothing in the case below. My code follows the before and after items below.
I would be most grateful for a solution.
Petra
BEFORE
Question 1
Body=blah blah
Answer=
Type=Multiple Select
Points=1
A. Nominated Client Cover
B. Carriers Legal Defence Cover
C. Fire and Theft only cover
D. Basic Cover
E. ~~~A, B and C
F. ~~~A, B and D
AFTER
Question 1
Body=blah blah
Answer=EF
Type=Multiple Select
Points=1
A. Nominated Client Cover
B. Carriers Legal Defence Cover
C. Fire and Theft only cover
D. Basic Cover
E. A, B and C
F. A, B and D
With Selection.Find
Do While .Execute(FindText:="~~~", Wrap:=wdFindStop, Forward:=True) = True
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Copy
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Answer="
.Replacement.Text = ""
.Forward = False
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.EndKey Unit:=wdLine
Selection.Paste
Loop
End With
I have put together bits of code that will put a multiple select question into a particular format for loading online. Part of the code involves pasting the letter to the left of ~~~ against Answer=. Below is what the text looks like before and after. However, although I seem to have used the same code for a find loop that I've used elsewhere (I think it was Doug Robins who provided it for me) it does absolutely nothing in the case below. My code follows the before and after items below.
I would be most grateful for a solution.
Petra
BEFORE
Question 1
Body=blah blah
Answer=
Type=Multiple Select
Points=1
A. Nominated Client Cover
B. Carriers Legal Defence Cover
C. Fire and Theft only cover
D. Basic Cover
E. ~~~A, B and C
F. ~~~A, B and D
AFTER
Question 1
Body=blah blah
Answer=EF
Type=Multiple Select
Points=1
A. Nominated Client Cover
B. Carriers Legal Defence Cover
C. Fire and Theft only cover
D. Basic Cover
E. A, B and C
F. A, B and D
With Selection.Find
Do While .Execute(FindText:="~~~", Wrap:=wdFindStop, Forward:=True) = True
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Copy
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Answer="
.Replacement.Text = ""
.Forward = False
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.EndKey Unit:=wdLine
Selection.Paste
Loop
End With