?
Solved

Delete footnotes in a Word document with VBA

Posted on 2012-08-22
2
Medium Priority
?
1,312 Views
Last Modified: 2012-08-22
There must be some easy way to delete all the footnotes in Word document.
The following code works if one knows that there are 44 footnotes are in a document, but there must be a better way.

Dim i as Integer
Do
      Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToNext, Count:=1, Name:=""
      Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
      Selection.Delete Unit:=wdCharacter, Count:=1
      i = i + 1
      If i = 44 Then End
Loop
Thanks for any help possible.
JRA
0
Comment
Question by:JohnRobinAllen
2 Comments
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 800 total points
ID: 38320406
Try this:
    Dim i As Integer
    For i = Application.ActiveDocument.Footnotes.Count To 1 Step -1
        Application.ActiveDocument.Footnotes(i).Delete
    Next

Open in new window

0
 

Author Closing Comment

by:JohnRobinAllen
ID: 38322348
The solution works beautifully. Many thanks!
   --j.r.a.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question