![]() |
|
#1
|
|||
|
|||
|
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
So the whole character count is not right. I tried adding IncludeFootnotesAndEndnotes:=True It's not working. Any idea ? Thanks ! Sylvain Last edited by macropod; 03-10-2021 at 02:45 PM. Reason: Added code tags |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Request for a macro to move footnotes (not formatted as footnotes) from end of page to end of doc | Pluckedchicken | Word VBA | 0 | 09-03-2020 05:21 AM |
How to change superscript footnotes into genuine Word footnotes
|
Knounte29 | Word VBA | 41 | 01-16-2020 04:48 PM |
| creating manuscript w/footnotes from separate documents containing chapters with footnotes-word 2010 | Dottie | Publisher | 0 | 02-19-2017 03:18 PM |
| Counting unique visitors by ward, counting monthly visits by status, editing existing workbook | JaxV | Excel | 9 | 11-14-2014 12:25 AM |
| Word counting macro for newly added portion? | New Daddy | Word VBA | 24 | 09-30-2013 07:30 PM |