A
ArthurN
Hi,
Hope that somebody can help me with the following: I need a macro to create
a cloze (or fill-in the gaps) assignment for my language class.
I have a pre-formatted documents with the following structure:
<heading 1>
<heading 2>
<story 1>
<heading 1>
<heading 2>
<story 2>
Now, each story has some words or phrases marked with, say, character style
“InlineVocabularyâ€.
I have to:
1. select all these words and phrases
2. move them to the end of the <story 1>
3. format them as a list, style “WordsToInsertâ€
4. sort the list
5. convert the list to two columns
6. remove these words and phrases from the story 1, substituting them by “1
_____†element
7. do the same to the second story, the third story, etc.
This should look something like this:
1.1 CALLING TECH SUPPORT
I recently (1). _________ for a new (2). _________ for my office, using (3).
_________.
1. DSL
2. ISP
3. Singed up
Actually, I have a macro, but it just doesn’t work as expected and something
is wrong with the sorting part:
Sub Vocabulary()
'
' AutoExit.MAIN Macro
'
'
Dim rDcm As Range
Dim LCnt As Long
Set rDcm = ActiveDocument.Range
rDcm.InsertAfter vbCrLf
With rDcm.Find
.Style = "InlineVocabulary"
While .Execute
rDcm.Select ' for testing
ActiveDocument.Range.InsertAfter rDcm.Text & vbCrLf
ActiveDocument.Paragraphs.Last.Previous.Range.Style = "WordsToInsert"
Wend
End With
Set rDcm = ActiveDocument.Range
'With rDcm.Find
' .Style = "WordsToInsert"
' If .Execute Then
' rDcm.Select
' Selection.End = ActiveDocument.Range.End - 1
' Selection.Sort
' End If
'End With
Set rDcm = ActiveDocument.Range
With rDcm.Find
.Style = "InlineVocabulary"
While .Execute
LCnt = LCnt + 1
rDcm.Select ' for testing
rDcm.Text = "(" & CStr(LCnt) & ") _________"
rDcm.Collapse Direction:=wdCollapseEnd
Wend
End With
End Sub
Thanks in advance,
Arthur N
Hope that somebody can help me with the following: I need a macro to create
a cloze (or fill-in the gaps) assignment for my language class.
I have a pre-formatted documents with the following structure:
<heading 1>
<heading 2>
<story 1>
<heading 1>
<heading 2>
<story 2>
Now, each story has some words or phrases marked with, say, character style
“InlineVocabularyâ€.
I have to:
1. select all these words and phrases
2. move them to the end of the <story 1>
3. format them as a list, style “WordsToInsertâ€
4. sort the list
5. convert the list to two columns
6. remove these words and phrases from the story 1, substituting them by “1
_____†element
7. do the same to the second story, the third story, etc.
This should look something like this:
1.1 CALLING TECH SUPPORT
I recently (1). _________ for a new (2). _________ for my office, using (3).
_________.
1. DSL
2. ISP
3. Singed up
Actually, I have a macro, but it just doesn’t work as expected and something
is wrong with the sorting part:
Sub Vocabulary()
'
' AutoExit.MAIN Macro
'
'
Dim rDcm As Range
Dim LCnt As Long
Set rDcm = ActiveDocument.Range
rDcm.InsertAfter vbCrLf
With rDcm.Find
.Style = "InlineVocabulary"
While .Execute
rDcm.Select ' for testing
ActiveDocument.Range.InsertAfter rDcm.Text & vbCrLf
ActiveDocument.Paragraphs.Last.Previous.Range.Style = "WordsToInsert"
Wend
End With
Set rDcm = ActiveDocument.Range
'With rDcm.Find
' .Style = "WordsToInsert"
' If .Execute Then
' rDcm.Select
' Selection.End = ActiveDocument.Range.End - 1
' Selection.Sort
' End If
'End With
Set rDcm = ActiveDocument.Range
With rDcm.Find
.Style = "InlineVocabulary"
While .Execute
LCnt = LCnt + 1
rDcm.Select ' for testing
rDcm.Text = "(" & CStr(LCnt) & ") _________"
rDcm.Collapse Direction:=wdCollapseEnd
Wend
End With
End Sub
Thanks in advance,
Arthur N