A definition is a statement of the meaning of a word or phrase.
I guess what Paul is asking is for you to provide a statement fo the
meaning SecondPartOfSentence (i.e., what is it that sets Part 2
apart from Part 1 and Part 3 of the complete string).
Sub ScratchMacro()
Dim oRng As Word.Range
If Selection.Sentences(1).Words.Count > 9 Then 'The condition
Set oRng = Selection.Sentences(1)
ActiveDocument.Bookmarks.Add "Name", oRng
'Assumes that part 1 is words 1 through 3 and part 3 is words 7
throghh
the end of the string.
oRng.Start = oRng.Words(3).Start
oRng.End = oRng.Words(6).End
oRng.Font.Color = wdColorRed
End If
End Sub
--
Greg Maxey - Word MVP
My web sitehttp://gregmaxey.mvps.org
Word MVP web sitehttp://word.mvps.org– Skjul sitert tekst –
– Vis sitert tekst –
OK - thanks
I will give an example
I have this variable; TekstOverJa = ForOverJa & Aar & EtterOverJa
where I want ForOverJato be written in red.
Dim ForOverNei As String, EtterOverNei As String, TekstOverNei As
String, ForOverJa As String, EtterOverJa As String, TekstOverJa As
String
ForOverJa = "[Overvurdering/Undervurdering] er vurdert vesentlig for
regnskapsavleggelsen for "
EtterOverNei = " og krever omtale i revisjonsberetningen. Vi ber om at
ledelsen for fremtiden anvender bedre og mer kvantitative metoder ved
estimeringen av verdi av vurderingsposter i regnskapet."
Aar=txtAar.Text
TekstOverJa = ForOverJa & Aar & EtterOverJa
If Opt2_4_Ja = Value Then
ActiveDocument.Bookmarks("bm2_4_1").Select
Selection.TypeText Text:=TekstJaA
Selection.TypeParagraph
End If