This is the Image here Following is the text with Syntax: "Question[space][1-30][colon][LineFeed]"
Looks Like≔" Question 1:
The Word 2007 File is here:
These are the Paragraphs:
All of the Following lines are ended with Line Feed (Shift Control) Character
But The List is not bulleted
- Discuss with your partner.
- Question 1:
- What ence...?
- Answer:
- There... together.
- Question 2:
- How d suggest ...”?
- Answer:
- The sto..either.
- Question 3:
- What lessons ...?
- Answer:
- ... them.
- Question 4:
- Why do you ...?
- Answer:
- Man is ...Scott.
About Code
- Code will apply to document not a part
- How to replace the last "Line Feed Character" with a Paragraph Mark.
- Paragraph style of this be "myHead4"
- Before Paragraph mark I want to write: (VImp) replaced by m1, (Imp2)replaced by m2, (Imp3) replaced by m4
- Any site about Wild Card Characters
- I am using the following code, But I failed how to use do..Loop.
- I am using two seperate codes for this purpose
- All this I want because I want to include Questions in my TOC.
Sub DeleteLineFeedAndTypeParagraph()
x = Asc(Selection.text)
y = Selection.Font.Color
Selection.Words(1).Select
Selection.HomeKey
Selection.Find.ClearFormatting
With Selection.Find
.text = "Question [0-9]{1,2}:^l"
.Replacement.text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
x = Selection.Characters.last
If Selection.Characters.last = chr(11) Then 'vbLf Line Break
Selection.Characters.last = vbCr
Selection.MoveEnd unit:=wdWord, Count:=1
Selection.Style = ActiveDocument.Styles("myHead4")
'x = Right(Selection, 1)
End If
End Sub
'The Second Procedure is
Sub SelectWordAndChangeText()
Selection.Words(1).Select
Select Case Selection.text
Case "m1"
Selection.text = "VImp"
Selection.Words(1).Italic = True
Case "m2"
Selection.text = "Imp"
End Select
End Sub