How to delete starting and ending character of a line.
I have documents in which each line starts and ends with ":"
How do I delete them without deleting other ":" in the document.
I tried this code to remove ":" from the beginning of a line but it deletes the entire line.
Sub CleanUp()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "'"
While .Execute
With oRng.Paragraphs(1).Range
If .Characters(1) = "'" Then .Delete
End With
Wend
End With
End Sub
I recorded my "Illiterate_In_Programming" macro using home, end, backspace, delete and arrow keys but it deletes paragraph formatting. Thanks a lot!!
Would you please recommend a book to learn VBA in word?