Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-19-2016, 12:34 PM
BolligeA1 BolligeA1 is offline Search Replace Code Windows 10 Search Replace Code Office 2013
Novice
Search Replace Code
 
Join Date: Feb 2016
Posts: 5
BolligeA1 is on a distinguished road
Default Search Replace Code

Hello everyone,

I have a word document with Endnotes in it, I would like to search and replace them.

In the Replace Box I entered:

Find What: ^e
Replace with: <a id="bn_^&" href="../Text/footnotes.html#n_^&">^&</a>
Result: <a id="bn_1" href="../Text/footnotes.html#n_2">3</a>

I would like to have this result, don't know how to do that:
<a id="bn_1" href="../Text/footnotes.html#n_1">1</a>

It is still a footnote, I would like for it to be plain text.

I would appreciate any help greatly, thank you, kindest Blessings
Reply With Quote
  #2  
Old 02-19-2016, 08:30 PM
macropod's Avatar
macropod macropod is offline Search Replace Code Windows 7 64bit Search Replace Code Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

A Find/Replace cannot convert endnotes or footnotes to body content.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-19-2016, 09:04 PM
BolligeA1 BolligeA1 is offline Search Replace Code Windows 10 Search Replace Code Office 2013
Novice
Search Replace Code
 
Join Date: Feb 2016
Posts: 5
BolligeA1 is on a distinguished road
Default

Thank you,

Is there any other way to change the content?

Thanks Kind blessings
Reply With Quote
  #4  
Old 02-19-2016, 10:00 PM
macropod's Avatar
macropod macropod is offline Search Replace Code Windows 7 64bit Search Replace Code Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

There are ways to transfer the content to the body via a macro, but it's not clear where in the body you want that content to go.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 02-20-2016, 09:38 AM
BolligeA1 BolligeA1 is offline Search Replace Code Windows 10 Search Replace Code Office 2013
Novice
Search Replace Code
 
Join Date: Feb 2016
Posts: 5
BolligeA1 is on a distinguished road
Default

Thanks again for your answer!

I would like to find all Endnotes, they are numbered (1,2,3....1000) and then taking
each endnote and do this:

case Endnote 1:
replace the whole Endnote 1 in the word text by this:
<a id="bn_1" href="../Text/footnotes.html#n_1">1</a>

case Endnote 2:
replace the whole Endnote 2 in the word text by this:
<a id="bn_2" href="../Text/footnotes.html#n_2">2</a>

I would appreciate any further help greatly, thank you, kindest blessings
Reply With Quote
  #6  
Old 02-20-2016, 01:46 PM
macropod's Avatar
macropod macropod is offline Search Replace Code Windows 7 64bit Search Replace Code Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

And what becomes of the content of the endnote/footnote?

PS: It would also help if you stuck to whichever term applies to what you are using. Endnotes are not footnotes. The two are entirely different and require different code to process.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 02-20-2016, 02:08 PM
BolligeA1 BolligeA1 is offline Search Replace Code Windows 10 Search Replace Code Office 2013
Novice
Search Replace Code
 
Join Date: Feb 2016
Posts: 5
BolligeA1 is on a distinguished road
Default

Thank you,

Sorry about that, it is all Endnotes.

I don't need the Endnotes anymore, once I have the html replacement set.

It is gone be an ebook at the end.

Thank you so much, for your help, kindest blessings
Reply With Quote
  #8  
Old 02-20-2016, 02:52 PM
macropod's Avatar
macropod macropod is offline Search Replace Code Windows 7 64bit Search Replace Code Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

In that case, try the following macro:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument
  For i = .Endnotes.Count To 1 Step -1
    With .Endnotes(i)
      .Reference.InsertAfter "<a id=""bn_" & i & """ href="" ../Text/endnotes.html#n_" & i & """>" & i & "</a>"
      .Delete
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
For Mac macro installation & usage instructions, see: http://word.mvps.org/Mac/InstallMacro.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 02-22-2016, 12:32 PM
BolligeA1 BolligeA1 is offline Search Replace Code Windows 10 Search Replace Code Office 2013
Novice
Search Replace Code
 
Join Date: Feb 2016
Posts: 5
BolligeA1 is on a distinguished road
Default

Thank you so very much, that worked Kindest Blessings
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Search and Replace puzzle grantworth Word 3 04-07-2015 05:32 AM
Search and replace/insert HTML code into Master File using tags dave8555 Excel 2 02-23-2014 03:51 PM
Search Replace Code search and replace dirkoo Word VBA 2 08-14-2013 11:25 AM
Search Replace Code Odd search and replace query Rabski Word 1 11-13-2012 02:25 PM
Search and Replace - Clear Search box JostClan Word 1 05-04-2010 08:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:52 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft