|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to delete automatically 500 “Heading 4” and all the contents in this from Navigation?
Hi guys,
I’m working with many cooking document files and having a question with these. Each cooking file has nearly 500 recipes and each recipe has a “Nutrition” part in “Heading 4” format. My task is that I have to delete all the Nutrition parts and contents in these. Usually, I do it manually by clicking right mouse at Heading Nutrition from Navigation and selecting “Delete”, but it takes a lot of time hmm.. I know that it is a repeating process and maybe has another method that make it easier and faster. So, who knows the quick method helping me delete all contents of Nutrition parts? Tell me pleaseee. Many thanks! ----------------------------------------------------- |
#2
|
|||
|
|||
Are you sure you really want to delete this information, rather than hide it? Someone went to a lot of work to gather that.
|
#3
|
|||
|
|||
Thanks for your answer and advice. Actually, I do this with 2 files. One still has Nutrition part and another hasn not. So I want to delete all of this. Can you help me to know the quick method? Thanks a lot!
|
#4
|
||||
|
||||
You could use a macro like:
Code:
Sub Demo() Application.ScreenUpdating = False Dim Rng As Range With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "Nutrition" .Replacement.Text = "" .Forward = True .Format = True .Style = "Heading 4" .Wrap = wdFindStop .MatchCase = True .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute End With Do While .Find.Found Set Rng = .Duplicate Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\HeadingLevel") Rng.Delete .Collapse wdCollapseEnd .Find.Execute Loop End With Application.ScreenUpdating = True End Sub For Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Awww.. It's really wonderful.! I deleted 500 nutritions with only 1 click.! Now, my task is very easy and quick. Thanks a lottt.. :3
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Setting default heading levels on the navigation plane | MattRNR | Word | 0 | 01-04-2016 04:41 AM |
I can't change the font of Heading 4 in my table of contents | hadigh84 | Word | 1 | 07-22-2015 08:56 PM |
How to remove HEading 4 from the Table Of Contents | elelont3 | Word | 2 | 01-17-2015 06:42 AM |
Navigation pane Show.Heading level x only | NobodysPerfect | Word VBA | 11 | 05-09-2014 05:26 AM |
How to have this Heading – Table of contents style? | Jamal NUMAN | Word | 0 | 01-13-2011 06:02 PM |