Microsoft KB Archive/131720

= WD: How to Remove HTML Tags with a Word Macro =

Article ID: 131720

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft Word 6.0 Standard Edition
 * Microsoft Word 6.0a
 * Microsoft Word 6.0c
 * Microsoft Word 6.0 for Macintosh
 * Microsoft Word 6.01 for Macintosh
 * Microsoft Word 6.0 Standard Edition
 * Microsoft Word 95 Standard Edition
 * Microsoft Word 95a

-



This article was previously published under Q131720



SUMMARY
This article provides a macro that selects and deletes HTML tags.



MORE INFORMATION
To remove HTML tags from your document, follow these steps:

 On the File menu, click Open. Click to select the Confirm Conversions check box and click your file. Click OK. In the Confirm Conversion dialog box, click Text Only. Click OK.  After the document opens, run the following macro. This macro will find, select, and remove the HTML tags: Sub MAIN StartOfDocument EditFind .Find = "<", .Direction = 0, .MatchCase = 0, \ .WholeWord = 0, .PatternMatch = 0, .SoundsLike = 0, \ .Format = 0, .Wrap = 2 While EditFindFound ExtendSelection ">" EditClear EditFind .Find = "<", .Direction = 0, .MatchCase = 0, \ .WholeWord = 0, .PatternMatch = 0, .SoundsLike = 0, \ .Format = 0, .Wrap = 2 Wend End Sub </ol>

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either expressed or implied, including but not limited to the implied warranties or merchantability and/or fitness for a particular purpose.

Additional query words: internet assistant HTML hypertext markup language hyper text

Keywords: kbhowto kbmacro kbmacroexample KB131720

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.