![]() |
#1
|
|||
|
|||
![]() How to get the number of words in the file (please see details)? Please, see the attached image that shows my question I need to know the words count except:
Why I need that? In most of the assignments, they need us to right up to 2000 words (for example) but the don’t count the words in table, header, footer, caption and in the page of refences. This is why we need an automatic way to get the net word count Is this feature available in word? Regard Jamal |
#2
|
||||
|
||||
![]()
Hi Jamal,
Word doesn't have anything built-in to do the word count the way you want it. it could be done with a macro, though.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Thank you for the answer.
actually, i'vo no experince how to work with macro. could you please elaborate more. this will save a lot of time, rigth now, i'm used to do the neet count of words manully, first i get the count of all words in the file, then the words in tables, then the caption, then the refernces. then words count = total count - words in table - words in caption - words in refernces should i continue doing it manually? regards jamal |
#4
|
|||
|
|||
![]()
Highlight the text you want to count. Click Review in the top menu. Select "Word Count" from the Proofing section of the Review ribbon menu. The count that appears is just the count for the area you've selected. If the text you want to count is broken up by tables and other elements that can throw off your count, two options:
1. Select the text areas as far as you can. Write down the total. Select the next text area. So forth. Add your totals. 2. Select and copy all the text you want to count. Paste it into a blank document. Count the new document. Delete the new document. |
#5
|
|||
|
|||
![]()
Thank you for the answer.
please, see the attached image that shows that words count directly the number of selected words. well, i think that the only soluiton is the MS word must be develpoed in such a way to achieve what we r looking for (which list). The method that you have provided is manual and not practical for large files which contains hundreds of pages. do u agree with me? Quote:
|
#6
|
||||
|
||||
![]()
Hi Jamal,
Give me some more time and I'll write a macro for you. Remember, this is a volunteer arrangement and we all need to fit these things in around whatever else we're doing...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
![]()
Sure.
very much appreciated. thank regards Jamal |
#8
|
|||
|
|||
![]() Quote:
|
#9
|
||||
|
||||
![]()
Hi Jamal,
The following macro gives you a wide range of statistics Code:
Sub CountWords() Application.ScreenUpdating = False Dim oTbl As Table, lTbl As Long, Sctn As Section Dim oHdFt As HeaderFooter, lHdr As Long, lFtr As Long Dim oEnt As Endnote, lEnt As Long Dim oFnt As Footnote, lFnt As Long Dim oShp As Shape, lShp As Long Dim oPara As Paragraph, lCpt As Long With ActiveDocument For Each oTbl In .Tables lTbl = lTbl + oTbl.Range.ComputeStatistics(wdStatisticWords) Next For Each oEnt In .Endnotes lEnt = lEnt + oEnt.Range.ComputeStatistics(wdStatisticWords) Next For Each oFnt In .Footnotes lFnt = lFnt + oFnt.Range.ComputeStatistics(wdStatisticWords) Next For Each Sctn In .Sections For Each oHdFt In Sctn.Headers If Not oHdFt.LinkToPrevious Then _ lHdr = lHdr + oHdFt.Range.ComputeStatistics(wdStatisticWords) Next For Each oHdFt In Sctn.Footers If Not oHdFt.LinkToPrevious Then _ lFtr = lFtr + oHdFt.Range.ComputeStatistics(wdStatisticWords) Next Next For Each oShp In .Endnotes If Not oShp.TextFrame Is Nothing Then _ lShp = lShp + oShp.TextFrame.TextRange.ComputeStatistics(wdStatisticWords) Next For Each oPara In .Paragraphs If oPara.Style = "Caption" Then _ lCpt = lCpt + oPara.Range.ComputeStatistics(wdStatisticWords) Next MsgBox "Word Count Statistics:" & vbCr & _ "Tables - " & vbTab & vbTab & lTbl & vbCr & _ "EndNotes - " & vbTab & lEnt & vbCr & _ "Footnotes - " & vbTab & lFnt & vbCr & _ "Headers - " & vbTab & vbTab & lHdr & vbCr & _ "Footers - " & vbTab & vbTab & lFtr & vbCr & _ "Shapes - " & vbTab & vbTab & lShp & vbCr & _ "Captions - " & vbTab & lCpt & vbCr & _ "Other - " & vbTab & vbTab & .Range.ComputeStatistics(wdStatisticWords) - lTbl - lCpt End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
![]()
Very much appreciated paul...but i don't have enough skills to use this macro! could u please explain "if ur time permits" how can i use it to get the statistics that i need.
thank you regards Jamal |
#11
|
||||
|
||||
![]()
Hi Jamal,
Quote:
For installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#12
|
|||
|
|||
![]()
Really, it's great job and would help a lot in counting the words and saving time.
i'm not sure if it is can be developed so that it ignors the count of words in certain pages. for example: the words in the cover page and page of refernces are not counted. otherwise, still we need to count the "effective" number of words in the document manually. This just if yout time permits. vey much appreciated Paul...fantastic. regards Jamal |
#13
|
|||
|
|||
![]()
I've another suggestion, if possibel:
why the word count in the micro doesn't count the number of words if we select certain paragraph or pages? instead, it gives the total for all words in the document. thank you regards Jamal |
#14
|
||||
|
||||
![]()
Hi Jamal,
Quote:
If you only want the word count for a selected range, change ‘ActiveDocument’ to ‘Selection’. Do note that, if you do this, the word counts for footnotes & end notes will relate to those anchored in the selected range, regardless of where they’re physically located. Header & Footer counts are based on one count per Section in the selected range (provided that Section is not linked to a previous one).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#15
|
|||
|
|||
![]()
Sorry bothering you again.
i've switched the ‘ActiveDocument’ to ‘Selection’ but didn't work...still counts the whole word in the document the image is attached what i might have done wrong? thank you regards Jamal Quote:
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
When Printing a file Sources/Details included | BigTunz | Word | 0 | 03-01-2010 01:24 AM |
Hide contact details | AndyKC | Outlook | 0 | 01-25-2010 11:00 PM |
Transfer of account details to Outlook 2003 on Windows7 | taralastair | Outlook | 1 | 01-04-2010 01:24 PM |
Printing task details | STEVEK | Outlook | 0 | 11-11-2009 06:02 AM |
Entering Contact details | GemmaD | Outlook | 0 | 12-18-2008 06:41 AM |