Hi
What I want to do is change Lecture to LECTURE.
What do I need to modify the macro below.
However, I only want to do this when Lecture is the only word on a line NOT when it is part of a sentence.
e.g.
Change all instances of Lecture to LECTURE when
line is : Lecture
and NOT:
A Maths Lecture starts at 9am.
Thx in advance.
Sub ChangeWords()
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
MyString = "Lecture"
StringLength = Len(MyString)
With Selection.Find
.Text = MyString
.Replacement.Text = "LECTURE"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = True 'False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
What I want to do is change Lecture to LECTURE.
What do I need to modify the macro below.
However, I only want to do this when Lecture is the only word on a line NOT when it is part of a sentence.
e.g.
Change all instances of Lecture to LECTURE when
line is : Lecture
and NOT:
A Maths Lecture starts at 9am.
Thx in advance.
Sub ChangeWords()
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
MyString = "Lecture"
StringLength = Len(MyString)
With Selection.Find
.Text = MyString
.Replacement.Text = "LECTURE"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = True 'False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub