View Single Post
 
Old 09-14-2012, 08:44 AM
kenglade kenglade is offline Mac OS X Office for Mac 2011
Novice
 
Join Date: Dec 2011
Location: Rio Rancho, NM
Posts: 26
kenglade is on a distinguished road
Default

Paul

This is the macro I'm trying to run:
Code:
Sub test()
'Macro created 29/09/99 by Doug Robbins to replace endnotes with textnotes at end of document
' and replace the endnote reference in the body of the document with a superscript number.
'
Dim aendnote As Endnote
For Each aendnote In ActiveDocument.Endnotes
  ActiveDocument.Range.InsertAfter vbCr & aendnote.Index & vbTab & aendnote.Range
  aendnote.Reference.InsertBefore "a" & aendnote.Index & "a"
Next aendnote
For Each aendnote In ActiveDocument.Endnotes
  aendnote.Reference.Delete
Next aendnote
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
  .Superscript = True
End With
With Selection.Find
  .Text = "(a)([0-9]{1,})(a)"
  .Replacement.Text = "\2"
  .Forward = True
  .Wrap = wdFindContinue
  .Format = True
  .MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
And the response is:
Run time error '4605'
This method or property is not available because the object spans a frame or note boundary

Note that macro was written in 1999, which was long before Word for Mac 2011. But what it wants to accomplish is exactly what I'm trying to do.

I very much appreciate your time.

Ken

Last edited by macropod; 09-14-2012 at 04:05 PM. Reason: Added code tags & formatting
Reply With Quote