![]() |
|
![]() |
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
![]()
Ok, I found a simple option to turn off auto numbering in the first macro. That should troubleshoot the problem you described above shouldn't it?
And I also found out that the macro is working way better when I write .Text = "(?@>)" instead of .Text = "" Because now i dont have whole pages formatted bold or italic. The only Problem left now is that the second macro does not find and replace words that are tagged with capitalized tags like <B>. (I actually dont know why the first macro is giving out some capitalized tags, but I think that must be the styles/formatting of the old documents). I tried to add .MatchCase = False to the second macro, but it makes no difference. I really overreached my knowledge cap right now and ranning out of ideas... would be so great if you could help me! The current to macros look like the following (I marked the passages red that I recently added on my own): Code:
Sub aaaaaQuelldok() ' hyphenation off ActiveDocument.AutoHyphenation = False ' auto numbering off ActiveDocument.Range.ListFormat.ConvertNumbersToText 'tag all formatted words 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 aaaaaZieldok() Application.ScreenUpdating = False With ActiveDocument.Range.Find .ClearFormatting .Replacement.ClearFormatting .Format = True .Forward = True .MatchWildcards = True .MatchCase = False .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 |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
redzan | Word VBA | 4 | 02-13-2016 12:24 PM |
![]() |
paik1002 | Word VBA | 4 | 12-07-2015 11:24 PM |
![]() |
kjxavier | Word | 1 | 01-02-2015 12:15 AM |
![]() |
rsrasc | Word VBA | 3 | 11-11-2014 03:55 PM |
![]() |
redzan | Word VBA | 1 | 07-27-2014 03:35 PM |