dj44
09-26-2017, 04:50 PM
folks
good day and nice to see everyone.
:)
now i wanted to only Capitalise the words between # and the hyphen -
before
# golden delicous - apples are tasty fruit
After
# Golden Delicous - apples are tasty fruit
there is 1 error, but i cant spot it.
it makes the words after the hypehen capitalise too. :think:
Sub Capitalise_words()
Dim oPar As Paragraph
Dim oRng As Range
For Each oPar In ActiveDocument.Paragraphs
If InStr(oPar.Range.Text, "#") > 0 Then
Set oRng = oPar.Range
oRng.MoveEndUntil Cset:="-", Count:=wdForward
oRng.End = oRng.End - 1
oPar.Range.Case = wdTitleWord
End If
Next oPar
lbl_Exit:
Exit Sub
End Sub
please do advise on my error, as it does look all ok to me
thank you
good day and nice to see everyone.
:)
now i wanted to only Capitalise the words between # and the hyphen -
before
# golden delicous - apples are tasty fruit
After
# Golden Delicous - apples are tasty fruit
there is 1 error, but i cant spot it.
it makes the words after the hypehen capitalise too. :think:
Sub Capitalise_words()
Dim oPar As Paragraph
Dim oRng As Range
For Each oPar In ActiveDocument.Paragraphs
If InStr(oPar.Range.Text, "#") > 0 Then
Set oRng = oPar.Range
oRng.MoveEndUntil Cset:="-", Count:=wdForward
oRng.End = oRng.End - 1
oPar.Range.Case = wdTitleWord
End If
Next oPar
lbl_Exit:
Exit Sub
End Sub
please do advise on my error, as it does look all ok to me
thank you