Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

MS Word Marco Help - Removing text between tags


  • Please log in to reply
1 reply to this topic

#1 Magic Dude

Magic Dude

  • Members
  • 30 posts
  • OFFLINE
  •  
  • Local time:12:20 PM

Posted 10 December 2011 - 01:31 PM

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

ps Using Word 2007

BC AdBot (Login to Remove)

 


#2 rincewindwiz

rincewindwiz

  • Members
  • 2 posts
  • OFFLINE
  •  
  • Local time:04:20 PM

Posted 13 December 2011 - 06:51 AM

If I have understood correctly you might find this approach easier
1. Type the document with all the text in it
2. Format the text you want to 'delete' as hidden (Format->Font->Effects and tick 'hidden')
This will hide the text
3. If you want to display the text go to Tools->Options->View and tick 'show hidden' text
Hope that helps
R




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users