Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #17  
Old 11-19-2012, 04:20 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

If I may come back to this old topic: I'm trying it out right now. I'm looking for a more specific string of text.
But when I try to execute the macro, it gives me an error 5560, and error detection (or whatever it's called in English) highlights this line for me:
Do While .Execute = True

What could be wrong with that?

I've modified the macro to look like this, to search for the texts I'd like to change into endnotes (i.e. texts like [EINDNOOT 1], where only the figure ever changes.

(I'd really appreciate any help -- it's to get Word to fix a faulty manual notation for endnotes, where both me and the source text of my translation made some errors in the numbering. I hope converting the manual notations to real Word endnotes will fix the numbering. I can always convert back to plain text if need be -- I hope.)

Quote:
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
Oh, and quick question: does this macro create endnotes numbered 1,2,3, &c? Because that's really what I need.
(I can do some stuff with search and replace and macros, but I don't know enough about Word's macro language to understand all of the codes in this macro.)
Reply With Quote
 

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 03:17 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