Jump to content

Please read the Forum Rules before posting.

Photo

Converting Footnotes to In-line Citations - Word Macro


  • Please log in to reply
5 replies to this topic

#1 Josh Bond

Josh Bond

    Administrator

  • Administrators
  • PipPipPipPipPip
  • 2,840 posts
  • LocationGallatin, TN
Offline

Posted 11 November 2011 - 11:45 PM

Sometimes, someone will give me a Microsoft Word document or RTF document with footnotes. I see these style footnotes in Word documents, RTF documents, etc. It must be a standard footnoting system used by word processors. The footnotes are at the bottom of each page. The footnote text isn't selectable when you copy and paste parts of the document. And it's generally a huge hassle to deal with footnotes because you have to figure out where you're going to put them in a module. And they don't copy very easily. And it's troublesome keeping them with the text they belong to.

This Word macro converts the footnotes into in-line citations. That way, the footnote text is salvaged. And because they are in-line, you don't have to worry with linking them. The citation format is [Note: ...]. The note color is dark blue, by default--but you can change that.

Tested with Word 2010:


Sub foot2inline()
Dim oFeets As Footnotes
Dim oFoot As Footnote
Dim oRange As Range
Dim szFootNoteText As String

' Grabs the collection of FootNotes
Set oFeets = Word.ActiveDocument.Footnotes

' Iterates through each footnote
For Each oFoot In oFeets
	

	
	szFootNoteText = oFoot.Range.Text
	
	'Start search from beginning of document
	Selection.HomeKey Unit:=wdStory
	Selection.Find.ClearFormatting
  
	With Selection.Find
		.Text = "^f" ' Looks for all footnotes
		.Forward = True
		.Wrap = wdFindStop
	End With
	
	Selection.Find.Execute
	' Delete the footnote
	oFoot.Delete
	
	'Insert the footnote text
	'Here you do whatever format tickles your fancy
	Selection.Text = " [Note: " + szFootNoteText + "] "

	'CHANGE COLOR HERE. Color code is below.
	Selection.Font.Color = 6299648

	'Disables undo to save memory on very large documents.
	ActiveDocument.UndoClear
Next
End Sub


#2 patchworkid

patchworkid

    Resource Builder

  • Members (T)
  • PipPipPipPipPip
  • 1,540 posts
  • LocationOld England
Offline

Posted 12 November 2011 - 02:52 AM

hi
Please help me understand where do i put this macros and how do i get it to work. (I do not use macros nor do i understand macros, All i know that it will help me in making modules)

I am looking on the net about macros in word.

thanks

Edited by patchworkid, 12 November 2011 - 02:58 AM.

Merismos the Scriptures with Patchworkid's Study Bible Set<p>http://www.biblesupp...tudy-bible-set/, MySword -http://www.biblesupp...tudy-bible-set/

#3 dyan

dyan

    e-Sword Addict

  • Veterans
  • PipPipPipPip
  • 89 posts
Offline

Posted 12 November 2011 - 04:20 AM

In MS Word
1) Press Alt+F11, this launces Visual Basic Editor
2) In VBE, in the project window, Right Click on Modules>Insert>Module
3) In the main window copy and paste Josh's macro
4) In the properties window, rename the module to foot2inline, or any name you want.
5) Save Normal and Close VBE
6) In MS Word to use the macro press Alt+F8, choose the macro, and press Run


Attached File  Visual Basic Editor.PNG   96.7K   29 downloads

#4 patchworkid

patchworkid

    Resource Builder

  • Members (T)
  • PipPipPipPipPip
  • 1,540 posts
  • LocationOld England
Offline

Posted 12 November 2011 - 05:03 AM

hi thanks dyan
Merismos the Scriptures with Patchworkid's Study Bible Set<p>http://www.biblesupp...tudy-bible-set/, MySword -http://www.biblesupp...tudy-bible-set/

#5 JPBjr

JPBjr

    New to Bible Support

  • Members
  • Pip
  • 1 posts
Offline

Posted 11 August 2017 - 01:04 PM

Thanks Josh

 

This macro works fine.

 

 



#6 APsit190

APsit190

    e-Sword Tools Developer

  • Members (T)
  • PipPipPipPipPip
  • 1,517 posts
  • LocationThe Land of the Long White Cloud
Offline

Posted 12 August 2017 - 02:05 PM

For those who do not use MS Office Word, but do use Open or LibreOffice Writer, there is also a similar built in type Macro tool which will do the same as Visual Basic for Office, and using the Alt+F11 keystroke.

 

Blessings,

Autograph.png





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users




Similar Topics



Latest Blogs