Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 08-03-2017, 11:21 AM
jpkell jpkell is offline Word macro for selecting text and putting it in footnotes Mac OS X Word macro for selecting text and putting it in footnotes Office 2016 for Mac
Novice
 
Join Date: Aug 2017
Posts: 4
jpkell is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
My old friend Greg jumped in and took over the thread, but to address your concerns with my original macro try
Code:
Sub Macro1()
Dim oRng As Range
Dim strText As String
Dim i As Long
    Set oRng = ActiveDocument.Range
    i = 1
    With oRng.Find
        Do While .Execute(FindText:="\[\[(*)\]\]", _
                          MatchWildcards:=True)
            strText = Replace(oRng.Text, "[", "")
            strText = Replace(strText, "]", "")
            ActiveDocument.Footnotes.Add oRng, CStr(i), strText
            oRng.Text = ""
            i = i + 1
            oRng.Collapse 0
        Loop
    End With
lbl_Exit:
    Set oRng = Nothing
    Exit Sub
End Sub
If that doesn't work for you, post a sample from the document.
Hi gmayor, I'm looking for help creating a macro similar to the one you created above.

Is there any chance you can whip up code for a macro that does the following:

Takes any string composed of a space, a left curly bracket, text (which may or may not include other curly brackets), a right curly bracket, and a period (such as " {Brennan, 2007, #74498}{George, 2012, #4564}{Maddow, 1977, #3456}." and...

1. Removes the " {Brennan, 2007, #74498}{George, 2012, #4564}{Maddow, 1977, #3456}" (including the first space);
2. Creates a new footnote *after* the period; and
3. Inserts "{Brennan, 2007, #74498}{George, 2012, #4564}{Maddow, 1977, #3456}." as the new footnote's text (with no space preceding the left curly bracket).

If this is possible you'd, like, be my hero for millennia!
Reply With Quote
 

Tags
footnotes, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word macro for selecting text and putting it in footnotes Word 2013 does not search text in footnotes unless I first click in a footnote amz Word 1 11-18-2015 01:56 PM
Word macro for selecting text and putting it in footnotes word 2007 - footnotes and text box glggluig Word 1 08-10-2014 04:09 AM
Putting text in color shapes dianabanana Word 1 04-07-2014 08:07 PM
Word macro for selecting text and putting it in footnotes Putting text to Excel Leandro Office 2 03-01-2012 11:51 PM
Selecting the macro document lars Word VBA 0 08-19-2010 06:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:28 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