Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 01-21-2024, 05:26 PM
Guessed's Avatar
Guessed Guessed is offline Loop keeps breaking. Windows 10 Loop keeps breaking. Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I did have a look at your attached docs and can see that you are probably trying to extract info using the html formatting tags as your data type indicators but your methodology is overly complicated.

Using Windows(x) and selections is a quick way to complete chaos which is why I'm not going to suggest an alternative approach.

I recommend you stay in the one document and simply remove anything you don't want. For example, it looks like you don't want any of the hyperlink info so strip that out.
Code:
Sub RemoveLinkTags()
  With ActiveDocument.Range.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "\<a*\>"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchKashida = False
    .MatchDiacritics = False
    .MatchAlefHamza = False
    .MatchControl = False
    .MatchAllWordForms = False
    .MatchSoundsLike = False
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
    
    .Text = "</a>"
    .MatchWildcards = False
    .Execute Replace:=wdReplaceAll
  End With
End Sub
Work out how to identify the start and end of chunks that you don't want and strip them out systematically. You can replace with "^t" if you want a tab to replace a chunk you are removing.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Do Loop Breaking Up. donlincolnmsof Word VBA 6 12-29-2021 02:52 PM
Loop keeps breaking. Getting rid of Non-breaking space WJSwanepoel Word VBA 3 03-30-2021 11:35 PM
Loop keeps breaking. non-breaking ] and [ nielsgeode Word 13 08-18-2017 11:48 PM
Equation non-breaking mohsen.amiri Word 2 02-04-2017 12:03 AM
Non-breaking items judicial85 Word 7 02-23-2012 07:12 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:20 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft