#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    8
    Rep Power
    0

    Word Macro question...


    I am trying to create a word macro that will replace all the extended characters in a document to their html counter-parts. For example:

    Or, does someone know of a program that will take a word doc and replace all the extended characters with their html counter-parts?

    Symbol HTML





    Bold Text
    Italic Text

    HTML
    &# 151;
    &# 147;
    &# 148;
    &# 145;
    &# 146;
    <b.>whatever</b.>
    <i.>whatever</i.>



    I am able to replace all of the listed characters above but I cannot replace italic and bold tags and then save the macro and get it to load. I can do it manually but I need this to be automated as well.

    In other words, I setup the macro with all the settings and test and it works fine but as soon as I close out word and open back up the macro it works fine on everything but replacing bold and italic tags.

    Here is my code for those sections:

    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
    .Text = ""
    .Replacement.Text = "<i>^&</i>"
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    End With


    I think I need to specify some kind of character in the " .Text = "" area of my examle code above to get bold and italics to work correctly.

    Can anyone help me with this or point me to a macro that has already done this?
    Last edited by mstubble; June 23rd, 2003 at 10:47 AM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Melbourne, Australia
    Posts
    212
    Rep Power
    12
    Depending on what you are trying to achieve, you can use the Word "Save As" feature, and select web document.
    How can I soar like an eagle when
    I'm flying with turkey's?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    8
    Rep Power
    0
    Well, I kind of just stated what I am trying to do and the 'save as' feature will not do anything for me in regard to my problem.

IMN logo majestic logo threadwatch logo seochat tools logo