Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-21-2015, 06:00 PM
nufc89 nufc89 is offline Replacing punctuation marks with footnotes Windows Vista Replacing punctuation marks with footnotes Office 2007
Novice
Replacing punctuation marks with footnotes
 
Join Date: May 2015
Posts: 2
nufc89 is on a distinguished road
Default 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!
Reply With Quote
  #2  
Old 05-21-2015, 10:13 PM
gmayor's Avatar
gmayor gmayor is offline Replacing punctuation marks with footnotes Windows 7 64bit Replacing punctuation marks with footnotes Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,105
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #3  
Old 05-22-2015, 03:15 PM
nufc89 nufc89 is offline Replacing punctuation marks with footnotes Windows Vista Replacing punctuation marks with footnotes Office 2007
Novice
Replacing punctuation marks with footnotes
 
Join Date: May 2015
Posts: 2
nufc89 is on a distinguished road
Default

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
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing punctuation marks with footnotes 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
Replacing punctuation marks with footnotes What do these marks mean? Jenjen80 Word 1 07-22-2010 07:08 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:46 PM.


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