![]() |
|
#1
|
||||
|
||||
![]() If you're going to craft your own macro to do this sort of thing, you'll need to do a great amount of work specifying all the criteria. To give you an idea of what's involved, the following macro applies HTML tags for just bold, italics and/or underline text, plus highlighting. Enabling the commented-out line converts auto-numbering to static text so it, too, can be processed. Code:
Sub ApplyHTML() Application.ScreenUpdating = False With ActiveDocument.Range '.ListFormat.ConvertNumbersToText With .Find .ClearFormatting .Replacement.ClearFormatting .Format = True .Forward = True .MatchWildcards = True .Wrap = wdFindContinue .Font.Underline = True .Text = "" .Replacement.Text = "<u>^&</u>" .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 .ClearFormatting .Highlight = True .Replacement.Text = "<h>^&</h>" .Execute Replace:=wdReplaceAll End With .Style = wdStyleNormal .Font.Reset .HighlightColorIndex = wdNoHighlight End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
Thanks to providing this macro Paul!!
I will check and get back to you if any helps needed. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need to copy texts from excel and paste in to the Notepad++ in between the particular tags | ganesang | Word VBA | 2 | 08-27-2018 02:05 AM |
![]() |
Suy Vanda | Word | 1 | 01-02-2018 05:54 AM |
Texts seperation | Tekabi | Word | 1 | 10-10-2017 02:46 PM |
Selecting Texts | mohsen.amiri | Word | 5 | 02-19-2015 11:50 PM |
Replacing texts | aslamyahya | Excel Programming | 1 | 02-27-2013 10:38 PM |