Consulting

Results 1 to 2 of 2

Thread: complicated Help about VBA, Find/Replace

  1. #1

    Unhappy complicated Help about VBA, Find/Replace

    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-prog...d-replace.html
    Last edited by Ethen5155; 10-14-2017 at 01:31 PM.

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •