Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-10-2011, 09:44 AM
mruetz mruetz is offline Word Marco Help - removing tagged text Windows 7 64bit Word Marco Help - removing tagged text Office 2007
Novice
Word Marco Help - removing tagged text
 
Join Date: Dec 2011
Posts: 10
mruetz is on a distinguished road
Question Word Marco Help - removing tagged text

I want to create marco in Word which will remove text between 2 tags throughout a document, for example



{begin tag}
This is the text to be removed.
{end tag}

The tagged text will appear throughout a large document and will have multiple instances where it needs to be removed.

These tags will always be the same and the text needs to be deleted between the 2 tags. This will allow me to maintain 2 different versions of a similar report in one document and generate 2 final reports with a macro.

Any ideas if this can be done and if so how?

thanks, Matt
Reply With Quote
  #2  
Old 12-11-2011, 02:06 AM
macropod's Avatar
macropod macropod is offline Word Marco Help - removing tagged text Windows 7 64bit Word Marco Help - removing tagged text Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Matt,

Providing the blocks of text to be removed aren't too long, you can do this with a wildcard Find/Replace, where:
Find = \{begin tag\}*\{end tag\}
Replace = nothing
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 12-12-2011, 08:27 AM
mruetz mruetz is offline Word Marco Help - removing tagged text Windows 7 64bit Word Marco Help - removing tagged text Office 2007
Novice
Word Marco Help - removing tagged text
 
Join Date: Dec 2011
Posts: 10
mruetz is on a distinguished road
Default

Thanks Paul. I will try this. The amount of text can be several paragraphs maybe even a page. Would that be too much?
Reply With Quote
  #4  
Old 12-12-2011, 08:46 AM
mruetz mruetz is offline Word Marco Help - removing tagged text Windows 7 64bit Word Marco Help - removing tagged text Office 2007
Novice
Word Marco Help - removing tagged text
 
Join Date: Dec 2011
Posts: 10
mruetz is on a distinguished road
Default

Hi Paul - This worked great on my test document (after I turned on wildcards). Any ideas on what the limitation might be on the amount of text between tags?
thanks for your help, Matt
Reply With Quote
  #5  
Old 12-12-2011, 10:07 PM
macropod's Avatar
macropod macropod is offline Word Marco Help - removing tagged text Windows 7 64bit Word Marco Help - removing tagged text Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Matt,

I'm not sure what the upper limit is, but a quick test with a 16-page block with 75k+ characters worked OK.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 12-13-2011, 07:53 AM
mruetz mruetz is offline Word Marco Help - removing tagged text Windows 7 64bit Word Marco Help - removing tagged text Office 2007
Novice
Word Marco Help - removing tagged text
 
Join Date: Dec 2011
Posts: 10
mruetz is on a distinguished road
Default

Hi Paul- Thanks for your help on this. This has worked out perfect, I completed my macros and all is working great!!!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word Marco Help - removing tagged text Removing tabs Taylor Word 10 11-28-2011 03:38 PM
Word Marco Help - removing tagged text Removing Office Starter BigJohn Office 1 11-25-2011 07:26 AM
Word Marco Help - removing tagged text Removing protected appointments jessejane Outlook 1 09-02-2011 10:21 AM
Removing Custom XML Ulodesk Word 0 06-24-2011 09:01 AM
Removing All Formating basscarp Word 0 01-31-2010 05:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:01 AM.


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