Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-26-2019, 09:00 AM
Brainiac Brainiac is offline Converting certain footnotes to endnotes Windows 7 64bit Converting certain footnotes to endnotes Office 2016
Novice
Converting certain footnotes to endnotes
 
Join Date: Jun 2019
Posts: 3
Brainiac is on a distinguished road
Default Converting certain footnotes to endnotes

Hello people,



i would like to convert thousands of footnotes, that have certain properties to endnotes.

code that does not work correctly:

Code:
Sub ConvertFootnotesEndnotes02()
Dim CertainFN As Footnote
    For Each CertainFN In ActiveDocument.Footnotes
    Selection.Find.Style = ActiveDocument.Styles("Endnote")
    With Selection.Find
    .Text = "$$$" 
    .Replacement.Text = "§§§"
             CertainFN.Range.Footnotes.Convert
    End With
           Next CertainFN
lbl_Exit:
    Exit Sub
 End Sub
this humble attempt fails, it converts every footnote to endnotes


would someone please help me?
Reply With Quote
  #2  
Old 06-26-2019, 03:11 PM
gmaxey gmaxey is offline Converting certain footnotes to endnotes Windows 10 Converting certain footnotes to endnotes Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,428
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Maybe:
Code:
Sub ConvertFootnotesEndnotes02()
Dim CertainFN As Footnote
  For Each CertainFN In ActiveDocument.Footnotes
    If InStr(CertainFN.Range.Text, "$$$") > 0 Then
      CertainFN.Range.Text = Replace(CertainFN.Range.Text, "$$$", "§§§")
      CertainFN.Reference.Footnotes.Convert
    End If
  Next CertainFN
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 06-27-2019, 03:46 AM
Brainiac Brainiac is offline Converting certain footnotes to endnotes Windows 7 64bit Converting certain footnotes to endnotes Office 2016
Novice
Converting certain footnotes to endnotes
 
Join Date: Jun 2019
Posts: 3
Brainiac is on a distinguished road
Default

Dear Craig,



thank you very much for your kind help. Your code works excellently for me. Unfortunately, the search term "§§§" has an unfavorable position. It stands directly in front of the footnote sign in the footnote with style "Endnote" and can't be found this way. But by a small trick I could change the default and managed to do the job with your code.



Thank you
Reply With Quote
  #4  
Old 07-02-2019, 04:31 AM
Brainiac Brainiac is offline Converting certain footnotes to endnotes Windows 7 64bit Converting certain footnotes to endnotes Office 2016
Novice
Converting certain footnotes to endnotes
 
Join Date: Jun 2019
Posts: 3
Brainiac is on a distinguished road
Default Styles are lost during Conversion

Although i applied character style formats before converting to endnotes, I just noticed that the character styles are lost during conversion.


Is there a way to avoid this failure during conversion?


Edit: This only occurs with Word 2003
With Word 2016 it works like a charm

Last edited by Brainiac; 07-02-2019 at 06:59 AM.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting certain footnotes to endnotes Footnotes / Endnotes? | See attachment modene1 Word 2 05-17-2017 02:53 AM
Changing footnotes to endnotes Sarah Word 3 04-27-2017 08:55 PM
Converting certain footnotes to endnotes How to display the full citation in footnotes/endnotes chakyt22 Word 1 09-29-2015 03:37 AM
Converting certain footnotes to endnotes Converting hard-entered endnotes to footnotes? New Daddy Word VBA 1 10-21-2012 02:51 PM
Converting certain footnotes to endnotes Endnotes within Footnotes? elias Word 12 09-04-2012 04:12 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:40 AM.


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