Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-10-2021, 06:45 AM
Sylvain Sylvain is offline Counting footnotes in Word Windows 10 Counting footnotes in Word Office 2016
Novice
Counting footnotes in Word
 
Join Date: Mar 2021
Posts: 1
Sylvain is on a distinguished road
Default Counting footnotes in Word

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

Last edited by macropod; 03-10-2021 at 02:45 PM. Reason: Added code tags
Reply With Quote
Reply

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
Counting footnotes in Word 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

Other Forums: Access Forums

All times are GMT -7. The time now is 02:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft