Hello everyone,
I use this macro to count characters on each section of a word document and write each count in an Excel file.
Code:
Sub CountSection()
Dim NumSec As Integer
Dim S As Integer
Dim Summary As String
Dim appXl As Excel.Application
Dim wb As Excel.Workbook
Set appXl = GetObject(, "Excel.Application")
' Set appXl = CreateObject("Excel.Application")
appXl.Visible = True
Dim LastRow As Long
appXl.Range("D17").Select
NumSec = ActiveDocument.Sections.Count
For S = 2 To NumSec
Summary = Summary & ActiveDocument.Sections(S).Range.ComputeStatistics(Statistic:=wdStatisticCharactersWithSpaces)
appXl.Selection.Offset(1, 0).Select
appXl.Selection.Value = Summary
Summary = 0
Next
End Sub
The problem is I can't count the character of the footnotes of each section.
So the whole character count is not right.
I tried adding IncludeFootnotesAndEndnotes:=True
It's not working.
Any idea ?
Thanks !
Sylvain