Set word_app = CreateObject("Word.Application")
Set word_doc = word_app.Documents.Open("C:\wrd.doc")
'Counting the number of paragraphs. Blank lines are also considered as paragraphs, that is why we have an “if loop” below which helps in removing the blank lines. It does not matter how many blank lines are there in between two paragraphs, it removes all.
para_count = word_doc.Paragraphs.Count
For a = 1 to para_count
'Using paragraph and range object to get one paragraph at a time.
start_range = word_doc.Paragraphs(a).Range.StartNext
Set t_range = word_doc.Range(start_range, end_range)
x_str = t_range.Text
if len(x_str) = 1 then
Set word_doc = Nothing
Set word_app = Nothing