![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#8
|
||||
|
||||
|
I am unable to replicate the behaviour you describe. Perhaps you could attach the actual document exhibiting the behaviour to a post (delete anything sensitive). You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
As for the codes you're using, I'd have been inclined to used something closer to standard HTML: Code:
Sub aabFettKursivQuelldok() Application.ScreenUpdating = False With ActiveDocument.Range.Find .ClearFormatting .Replacement.ClearFormatting .Format = True .Forward = True .MatchWildcards = True .Wrap = wdFindContinue .Font.Underline = True .Text = "" .Replacement.Text = "<u>^&</u>" .Execute Replace:=wdReplaceAll .ClearFormatting .Highlight = True .Replacement.Text = "<h>^&</h>" .Execute Replace:=wdReplaceAll .ClearFormatting .Font.Bold = True .Replacement.Text = "<b>^&</b>" .Execute Replace:=wdReplaceAll .ClearFormatting .Font.Italic = True .Replacement.Text = "<i>^&</i>" .Execute Replace:=wdReplaceAll End With Application.ScreenUpdating = True End Sub Code:
Sub aabFettKursivZieldok() Application.ScreenUpdating = False With ActiveDocument.Range.Find .ClearFormatting .Replacement.ClearFormatting .Format = True .Forward = True .MatchWildcards = True .Wrap = wdFindContinue .Replacement.Text = "\1" .Text = "\<u\>(*)\</u\>" .Replacement.Font.Underline = True .Execute Replace:=wdReplaceAll .Replacement.ClearFormatting .Text = "\<h\>(*)\</h\>" .Replacement.Highlight = True .Execute Replace:=wdReplaceAll .Replacement.ClearFormatting .Text = "\<b\>(*)\</b\>" .Replacement.Font.Bold = True .Execute Replace:=wdReplaceAll .Replacement.ClearFormatting .Text = "\<i\>(*)\</i\>" .Replacement.Font.Italic = True .Execute Replace:=wdReplaceAll End With Application.ScreenUpdating = True End Sub .Text = "" to: .Text = "[!^13]{1,}"
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro to find and replace headings in bold and underline
|
redzan | Word VBA | 4 | 02-13-2016 12:24 PM |
Find, select, and replace part of text with bold
|
paik1002 | Word VBA | 4 | 12-07-2015 11:24 PM |
Find and Replace some characters with Bullets
|
kjxavier | Word | 1 | 01-02-2015 12:15 AM |
Find/Replace Wildcard Needed-Bold & Highlight
|
rsrasc | Word VBA | 3 | 11-11-2014 03:55 PM |
find and replace in bold
|
redzan | Word VBA | 1 | 07-27-2014 03:35 PM |