How to Fix Error 500? - Http 500 Error Fixer
last updated on: 11/10/16 08:45AM
   Tech Support Determining Number of Word in a Section [27/09/16 05:09AM]   
You already voted for this post!

Determining Number of Word in a Section

I need to count, using VBA, the number of words within the current section (i.e., between the forced hard page separators), including both the body of the text and all of the footnotes.
 
Since all of the footnotes are within the current section, technically, in my case, the result would be the same if we count all of the footnote words or just those associated with the section.
These are very long documents so manually selecting the area takes forever and that does not count the footnotes.
How is that done?
TIA

Anwsers to the Problem Determining Number of Word in a Section

Download Error Fixer (Free)

Your post is ambiguous.
You refer to sections but define them per hard page breaks.
Hard page breaks don't start/end a Section - Section breaks do.
The following macro counts the # words on the current page, including words in referenced footnotes & endnotes.
Sub PageWordCount()
Dim oFoot As Footnote, oEnd As Endnote
Dim iPg As Long, iCount1 As Long, iCount2 As Long, iCount3 As Long
iCount1 = 0: iCount2 = 0: iCount3 = 0
With ActiveDocument.Bookmarks("Page").Range
  iPg = .Information(wdActiveEndAdjustedPageNumber)
  iCount1 = .ComputeStatistics(wdStatisticWords)
  For Each oFoot In .Footnotes
    If oFoot.Range.Information(wdActiveEndAdjustedPageNumber) = iPg Then _
    iCount2 = iCount2 + oFoot.Range.ComputeStatistics(wdStatisticWords)
  Next
  For Each oEnd In .Endnotes
    If oEnd.Range.Information(wdActiveEndAdjustedPageNumber) = iPg Then _
    iCount3 = iCount3 + oEnd.Range.ComputeStatistics(wdStatisticWords)
  Next
End With
MsgBox Prompt:="Body: " & vbTab & vbTab & iCount1 & vbCr & _
  "Footnotes: " & vbTab & iCount2 & vbCr & _
  "Endnotes: " & vbTab & vbTab & iCount3 & vbCr & _
  "Total: " & vbTab & vbTab & iCount1 + iCount2 + iCount3, _
  Title:=" Word Count for Page " & iPg
End Sub
The following macro counts the # words in the current Section, including words in footnotes & endnotes.
Sub SectionWordCount()
Dim oFoot As Footnote, oEnd As Endnote
Dim iSct As Long, iCount1 As Long, iCount2 As Long, iCount3 As Long
iCount1 = 0: iCount2 = 0: iCount3 = 0
iSct = Selection.Information(wdActiveEndSectionNumber)
With ActiveDocument.Sections(iSct)
  iCount1 = .Range.ComputeStatistics(wdStatisticWords)
  For Each oFoot In .Range.Footnotes
    iCount2 = iCount2 + oFoot.Range.ComputeStatistics(wdStatisticWords)
  Next
  For Each oEnd In .Range.Endnotes
    iCount3 = iCount3 + oEnd.Range.ComputeStatistics(wdStatisticWords)
  Next
End With
MsgBox Prompt:="Body: " & vbTab & vbTab & iCount1 & vbCr & _
  "Footnotes: " & vbTab & iCount2 & vbCr & _
  "Endnotes: " & vbTab & vbTab & iCount3 & vbCr & _
  "Total: " & vbTab & vbTab & iCount1 + iCount2 + iCount3, _
  Title:=" Word Count for Section " & iSct
End Sub
Note: The footnote and endnote counts pertain to footnotes and endnotes attached to a footnote/endnote reference on the current page/section, even if some/all of their content is on another page/section.
Conversely, footnote
and endnote content on the current page/section is not reported if the footnote/endnote reference is on another page/section.
Neither macro counts content in page headers/footers or textboxes.

Using Windows troubleshooter:

  • Click on Search on Charm bar and type Troubleshooting. Click on the very first option.
  • A new window will open. Click View all from the left pane.
  • Scroll down to the bottom and click on Windows update.
  • Troubleshooter window for Windows update will pop up. Click on NEXT. It may ask you for administrative permission.
  • The troubleshooter will automatically detect problems and fix it.
  • Now, close this window and try download/install the app which was previously showing error.

Another Safe way to Repair the Problem: Determining Number of Word in a Section:

How to Fix Determining Number of Word in a Section with SmartPCFixer?

1. Click the button to download SmartPCFixer . Install it on your computer.  Run it, and it will scan your computer. The junk files will be shown in the list.

2. After the scan is done, you can see the errors and problems which need to be fixed.

3. The Fixing part is finished, the speed of your computer will be much higher than before and the errors have been fixed.


Related: Way to Update & Download SONY SVE14A2X1EH Wireless State Device driver,How to Update & Download SONY SVS1511X9RB Graphics Driver for D2 (Intel) v.9.17 - 9.17.10.2828,Method to Download SONY VGN-CR290N Realtek High Definition Audio Driver v.5.10.0.5433,Download SONY VGN-FS710/W Utilities DLL Update v.6.4.0.06290 driver,Method to Update & Download SONY VGN-NR460E/P Intel Graphics Media Accelerator Driver v.6.14.10.4847,How to Fix Error 0x0000c1f5 Solución?,Error 0x80071a91 Win7 Fix Patch,Error 0x800ccc60 Windows Live Mail [Solved],Error Message 0x800ccc79 Outlook 2000 Fix,What is Error 0xc1ab0001?,[Answered] x64 saplugin dll,How to Fix Problem - Kb943729 Download?,Troubleshooting: Bccode D1 Error,Java Runtime Tech Support,Troubleshooting: ERROR NO SUCH GROUP Error,Solution to ashoutxt.dll Missing Error,Solution to cxcore096.dll Missing Error,Where can I Find dsauth.dll File,How to Fix msde.dll Not Found Error,Best Method to Fix psizewizres.dll Error
Read More: Troubleshoot:Determine is shape object exists in a cell (VBA) Error,Fast Solution to Error: deactivate a hacked hotmail account , that has all my information on it,[Solution] De-activating admin accounts.,How Can You Fix - Default IME has stopped responding?,Fast Solution to Error: DEP closing down IE 8.0,Data validation question. Maintaining and updating named ranges.,Desktop Gadget Gallery on Windows 7,delete empty rows,Deleting a page and also how can I copy an exact page lay out on a new page,Date Formula for 1st Sunday of each Month (3rd to 9th)



   Trackbacks

      TRACKBACK URL: http://error500.blogghy.com/trackback/1032622

   Comments

   Post a comment
Name:


Email:


2 + 2 = ?

Please write above the sum of these two integers

Title:


Comments:





About the author

Contact the author
Categories

Latest blog posts
Error Server not found when loading Facebook Tech Support
[11/10/16 08:45AM]
Tech Support Determining Number of Word in a Section
[27/09/16 05:09AM]
Troubleshooting Cannot save Office files to a network share
[14/09/16 04:42AM]
Internet explorer has encountered a problem error
[13/07/16 05:35AM]
Troubleshoot ntoskrnl exe 75c00 Error
[04/07/16 11:05AM]
Top views posts
Error Server not found when loading Facebook Tech Support
[11/10/16 08:45AM] Daily Views 10
Tech Support Determining Number of Word in a Section
[27/09/16 05:09AM] Daily Views 7
Troubleshoot ntoskrnl exe 75c00 Error
[04/07/16 11:05AM] Daily Views 5
Internet explorer has encountered a problem error
[13/07/16 05:35AM] Daily Views 3
Troubleshoot How can I find the max of all rows in a table Error
[31/03/16 07:46AM] Daily Views 2
Photo Albums








Powered by Blogghy

Page generated in 0.5543 seconds.