word count of word document exported into excel

how would i go about doing the following. code example would be great..
lets say i have a document named test 10-14-15.rtf and i want to export statistics to an excel worksheet that is seperated by month.
so i have for instance 100 lines of i want it to do something like this
Date                         |   lines
<gotten from title>|   <gotten from word count statistics>

is this possible and how can i do it?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
do you have a sample of .rtf to upload here? we probably can't directly read a .rtf to Excel.
Saurabh Singh TeotiaCommented:


Then in B1 you can do this...


Open in new window

And if you want to convert that value as date then you can do this...


Open in new window

Format that as date and you will get the result what you are trying to achieve..

to access the word document statistics you will need VBA - the snippet below from MS TechNet and shows how a word macro can pull the details from another document; including .ComputeStatistics(wdStatisticLines) which is what you want to pull back.

To automate this process from within excel you will need to change it and there's an explanation of how to do that in the link below - I don't have time right now to got through it but if you are comfortable with VBA code its not very difficult.

If you need further help let us know and I'll respond later if someone hasn't covered it in the meantime

Word automation from Excel VBA

Const wdStatisticCharacters = 3
Const wdStatisticCharactersWithSpaces = 5
Const wdStatisticFarEastCharacters = 6
Const wdStatisticLines = 1
Const wdStatisticPages = 2
Const wdStatisticParagraphs = 4
Const wdStatisticWords = 0

Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open("C:\Scripts\Test.doc")

Wscript.Echo "Characters: " & _
Wscript.Echo "Characters with spaces: " & _
Wscript.Echo "Far East characters: " & _
Wscript.Echo "Lines: " & objDoc.ComputeStatistics(wdStatisticLines)
Wscript.Echo "Pages: " & objDoc.ComputeStatistics(wdStatisticPages)
Wscript.Echo "Paragraphs: " & objDoc.ComputeStatistics(wdStatisticParagraphs)
Wscript.Echo "Words: " & objDoc.ComputeStatistics(wdStatisticWords)

objDoc.Saved = TRUE

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bbimisAuthor Commented:
thanks that worked great
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.