C
Co
Hi All,
I'm trying to search in a doc for a subject line or lines.
sSubject = Selection
While InStr(sSubject, Chr(13)) = 0
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
sSubject = Selection
Wend
sSubject = Left(sSubject, Len(sSubject) - 1)
I tried as you can see to find a Chr(13) and then end the search but
that doesn't always work.
Sometimes a Return is given and then the sentence continues on the
next line.
I thought maybe search for a blank line but that doesn't work,
sometimes you have:
Subj: This is the subject line
which is followed by a new line
From: Me
Can anyone tell me how to solve this?
Marco
I'm trying to search in a doc for a subject line or lines.
sSubject = Selection
While InStr(sSubject, Chr(13)) = 0
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
sSubject = Selection
Wend
sSubject = Left(sSubject, Len(sSubject) - 1)
I tried as you can see to find a Chr(13) and then end the search but
that doesn't always work.
Sometimes a Return is given and then the sentence continues on the
next line.
I thought maybe search for a blank line but that doesn't work,
sometimes you have:
Subj: This is the subject line
which is followed by a new line
From: Me
Can anyone tell me how to solve this?
Marco