#1
|
|||
|
|||
Replacing punctuation marks with footnotes
Dear Geniuses,
I am trying to operate the FIND/REPLACE function to automatically insert 400 footnotes at once. When I write, I mark each citation or cited fact with an apostrophe (for example, John Smith, Historian, claims that ww2 'was inevitable from 1919'.) Instead of going through and adding footnotes by hand, I am trying to FIND (ctrl + f) all the apostrophes and replace them with footnotes. I have tried using the ^f in the REPLACE WITH box. The error message reads that it is not "valid special character for the replace with box". Thanks! |
#2
|
||||
|
||||
If you want to mark the areas where the quoted text was with a footnote reference and use the quoted text as the reference text you cannot do this with Find and Replace. You can do it with a macro e.g. as follows http://www.gmayor.com/installing_macro.htm but the macro may have problems distinguishing between single quotes and apostrophes. See how you get on with the macro on a COPY of the document.
The macro assumes straight quotes rather than smart quotes. Code:
Sub ReplaceWithFootnotes() 'Macro by G Mayor 22 May 2015 Dim oRng As Range Dim strNote As String Set oRng = ActiveDocument.Range With oRng.Find Do While .Execute(FindText:="[!A-Za-z0-9]'[A-Za-z0-9]", _ MatchWildcards:=True) oRng.MoveEndUntil Chr(39) oRng.End = oRng.End + 1 strNote = Replace(oRng.Text, Chr(39), "") oRng.Text = "" ActiveDocument.Footnotes.Add oRng, , strNote oRng.Collapse 0 Loop End With lbl_Exit: Set oRng = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
I have created the macro (though it took a bit of working out how), but when I run it in a document (in which it is saved), nothing happens. No luck unfortunately. Could you send me a script for something that changes the number 77 into footnotes to see if it works?
Theoretically, could you send the pre-packaged macro ready-made as an attachment? Thanks |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to delete all the punctuation marks from a paragraph? | Jamal NUMAN | Word | 3 | 02-26-2019 02:33 PM |
Punctuation | lexsper | Word | 0 | 04-06-2015 07:26 AM |
Convert manual cross references in footnotes to other footnotes to automatic cross references | ghumdinger | Word VBA | 7 | 11-20-2014 11:47 PM |
Punctuation against right margin "squishing" text backwards | blinkyzero | Word | 3 | 10-22-2014 10:05 AM |
What do these marks mean? | Jenjen80 | Word | 1 | 07-22-2010 07:08 AM |