Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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,142
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 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
 



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 09:25 PM.


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