Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-11-2016, 06:30 AM
gmaxey gmaxey is offline Word macro for selecting text and putting it in footnotes Windows 7 32bit Word macro for selecting text and putting it in footnotes Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Based on the clock, the mysterious one may have signed off for the day. It is elegant. I particularly like the lbl_Exit: Exit Sub part.



Code:
Sub Macro1()
Dim oRng As Range
Dim strText As String
Dim lngIndex As Long
  Set oRng = ActiveDocument.Range
  lngIndex = 1
  With oRng.Find
    While .Execute(FindText:="\[\[(*)\]\]", _
                   MatchWildcards:=True, _
                   ReplaceWith:="\1")
      ActiveDocument.Footnotes.Add oRng, CStr(lngIndex), oRng.Text
      lngIndex = lngIndex + 1
      oRng.Text = vbNullString
      oRng.Collapse 0
    Wend
  End With
lbl_Exit:
  Set oRng = Nothing
  Exit Sub
End Sub
You may find this interesting:
'http://gregmaxey.com/word_tip_pages/convert_reference_notes_to_dynamic_footnotes.html

A collaborative effort with Macropod.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #2  
Old 05-18-2016, 01:42 PM
mdhg mdhg is offline Word macro for selecting text and putting it in footnotes Windows 10 Word macro for selecting text and putting it in footnotes Office 2013
Novice
Word macro for selecting text and putting it in footnotes
 
Join Date: Feb 2016
Posts: 10
mdhg is on a distinguished road
Default

So I guess gmaxey tried to point me to the problem:

Quote:
Originally Posted by gmaxey View Post

You may find this interesting:
'http://gregmaxey.com/word_tip_pages/convert_reference_notes_to_dynamic_footnotes.html

A collaborative effort with Macropod.
But apparently I was too dense to take the hint.
When I try to run the macro in the link above it generates 6 (empty) dynamic footnotes (there are nearly 500 footnotes in the document) and exits with run time error 4605.

I assume that my lack of knowledge concerning VBA must be annoying to some of you. But I have been spending an awful lot of time working on the document for the past months only to notice now that there are no dynamic footnotes -- which is a requirement of the publisher that I have to submit the manuscript to in 12 days.
My bad, of course.
Any help to get those footnotes behaving like regularly generated Word footnotes would be most appreciated.
Reply With Quote
Reply

Tags
footnotes, vba

Thread Tools
Display Modes


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:13 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