PDA

View Full Version : complicated Help about VBA, Find/Replace



Ethen5155
10-14-2017, 01:16 PM
Hi all,

well then as i mentioned it is complicated issue but i will be so appreciated to one who can help me about it, as i need that macro badly..


i have HTML files to deal with and i found that the only way to do what i want is to copy the source code in word then do Find/Replace processes with VBA then back it again to HTML

1- i want to go through all the word file and look for any paragraph start with "<li id="footnote-"
2- then Copy the text starts and between with "<a href" to "</a>"
3- and put it after "<p>" in the same paragraph
4- then replace the number at the end of paragraph only that is between two brackets to "*"


for ex:

here is the line that i wan't the macro to get:



<li id="footnote-3"><p>XXalso of Virginia. We were extremely lucky <a href="#footnote-ref-3">[2]</a></p></li>


- the red text should be copied after <p> in the place that has green (XX) existed
- then replace the number [2] at the end of line to (*)

final result should be as following



<li id="footnote-3"><p><a href="#footnote-ref-3">[2]</a> also of Virginia.We were extremely lucky <a href="#footnote-ref-3">*</a></p></li>


please note that there are no colors in the file, that are only to explain it clear

i hope that someone can help me guys, i will own to him

Thanks in advance

Cross-Posting: https://www.excelforum.com/word-programming-vba-macros/1204762-complicated-help-about-vba-find-replace.html

macropod
10-15-2017, 12:01 AM
See my reply at: https://www.excelforum.com/word-programming-vba-macros/1204762-complicated-help-about-vba-find-replace.html