#1
|
|||
|
|||
Hide footnote numbering with vba
For a specific projet I need do remove, or, if it's not possible, hide footnote numbering with vba, or any equivalent possible solution with same result.
Example: Footnote: "------ 1 My footnote" Expected result: "------ My footnote" Thanks. |
#2
|
|||
|
|||
Modify the Footnote Reference style to include "Hidden" as a font format. The numbers will be hidden in both the footnote itself and the location in the text that refers to it.
|
#3
|
|||
|
|||
Code:
activedocument.Styles(wdStyleFootnoteReference).Font.Hidden = True Currently I'm setting the color of the font to white. With this, the numbering is invisible, but still uses a space before the footnote (one chr(2) and one chr(32) ), but this is almost irrelevant. Thanks |
#4
|
|||
|
|||
Sorry, running the same code (or modifying the style through the Modify Style dialog) here does hide the numbers. Can you verify that the numbers in your document actually have the Footnote Reference style applied to them? That's the default behavior of the References > Insert Footnote button, but yours could have been inserted some other way.
|
#5
|
|||
|
|||
Quote:
Code:
activedocument.Styles(wdStyleFootnoteReference).Font.Hidden=false activedocument.ActiveWindow.View.ShowHiddenText=False This is not working (it's removing entire footnote): Code:
ActiveDocument.Footnotes(1).Reference.Text = Replace(ActiveDocument.Footnotes(1).Reference.Text, Chr(32), "") Last edited by eduzs; 08-25-2019 at 06:14 PM. |
#6
|
|||
|
|||
Try this:
Code:
Sub Test() Dim oRng As Range ActiveDocument.Styles(wdStyleFootnoteReference).Font.Hidden = False Set oRng = ActiveDocument.StoryRanges(wdFootnotesStory) With oRng.Find .Style = "Footnote Reference" While .Execute oRng.Characters.Last.Next.Delete oRng.Text = vbNullString Wend End With ActiveDocument.Styles(wdStyleFootnoteReference).Font.Hidden = True ActiveDocument.ActiveWindow.View.ShowHiddenText = False End Sub |
#7
|
|||
|
|||
This seem not working, nothing occurs.
|
#8
|
|||
|
|||
What occurs here is the the footnote numbers in the text and in the footnote section of the document are removed along the space after the number.
|
#9
|
|||
|
|||
Quote:
Thanks gmaxey and jjfreedman. |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding footnote number as part of footnote text | NoCalScribe | Word VBA | 3 | 07-15-2019 07:20 PM |
Problem with footnote numbering -- Two different footnote levels | mdhg | Word | 7 | 05-19-2016 06:33 AM |
How to change the font of footnote numbering? | mudum | Word | 2 | 12-03-2015 06:27 AM |
Footnote numbering problem within single section | jsswadley | Word | 2 | 03-17-2015 04:44 PM |
Footnote get double numbering | malgorzata | Word | 2 | 12-12-2014 12:45 AM |