Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-19-2012, 02:05 PM
macropod's Avatar
macropod macropod is offline Macro to convert text to endnote? Windows 7 64bit Macro to convert text to endnote? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,520
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Your Find expression is malformed, instead of:
"\[EINDNOOT [0-9]{1;3}(\]"
you should have:
"\[EINDNOOT [0-9]{1;3}\]"
or
"\[EINDNOOT [0-9]{1;3}(\])"
Even then, however, the code won't work as the MID expression (in Mid(RngFnd.Text, 2, Len(RngFnd.Text) - 2)) would need to be modified to take account of your additional text.

There is a more sophisticated version of the macro, that can deal with your [EINDNOOT #] format, here: http://gregmaxey.com/word_tip_pages/...footnotes.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 11-20-2012, 06:30 AM
franklekens franklekens is offline Macro to convert text to endnote? Windows XP Macro to convert text to endnote? Office 2003
Novice
 
Join Date: Jul 2010
Posts: 29
franklekens is on a distinguished road
Default

Thanks a lot. That was very sloppy of me.

In the meantime, I *have* got the original macro working, even with my EINDNOOT text in between the brackets. As far as I'm aware it worked fine in this form:


Code:
Sub MakeEndNotes()
Dim RngSel As Range, RngFnd As Range, StrNote As String
Application.ScreenUpdating = False
With Selection
  Set RngSel = .Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .MatchWildcards = True
    .Wrap = wdFindContinue
    .Forward = True
    .Text = "\[EINDNOOT ([0-9]{1;3})\]"
    Do While .Execute = True
      Set RngFnd = ActiveDocument.Range(Start:=Selection.Start, End:=Selection.End)
      StrNote = Mid(RngFnd.Text, 2, Len(RngFnd.Text) - 2)
      ActiveDocument.Endnotes.Add RngFnd, , StrNote
      RngFnd.Text = vbNullString
    Loop
  End With
End With
RngSel.Select
Set RngFnd = Nothing: Set RngSel = Nothing
Application.ScreenUpdating = True
End Sub
I'm still not sure what all of the items refer to, my knowledge of the macro language doesn't go that far. Which makes the macro you refer to even more daunting for me. :-)

And since that also stalls on my Word, for the moment I'll stick to this one. (And try to be a little cleverer in how I add endnote indications in my text, so they're easier to search & replace or convert into real endnotes and back.)
Thanks anyway. Great that this thread is here for reference' sake.
Reply With Quote
Reply

Tags
convert text to endnote, macro



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to convert text to endnote? Creating macro to convert/print to pdf shabbaranks Word 3 05-18-2011 08:59 AM
Macro to convert text to endnote? Cross-reference endnote text smed Word 3 01-14-2011 03:34 PM
convert html to text at opening etfjr Word 0 12-13-2010 11:14 AM
Convert Number to Text devcon Word 0 07-10-2010 01:16 AM
Convert Dollar amount to text GeorgeLawshe Word 0 03-07-2010 10:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:48 AM.


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