![]() |
#1
|
|||
|
|||
![]()
How can I clear the 'OutlineLevel' property from all the paragraphs inside a selection, please?
The code below doesn't work, I'm just listing it here to give you an idea of what I'm looking for. Code:
With Selection.Find .OutlineLevel = wdOutlineLevel1 .Wrap = wdFindStop With .Replacement .OutlineLevel = wdOutlineLevelBodyText End With .Execute FindText:="", ReplaceWith:="", Format:=True, Replace:=wdReplaceAll End With The reason I'm looking for such a routine, is that from time to time it happens that I paste some text with paragraphs that show up as headings on the navigation panel, yet they do not have a 'heading' style attached to them. I checked, and they just have this 'OutlineLevel' property set. Once I remove it, the paragraphs no longer show under the navigation panel, which is what I'm looking for. The code should only search in the current selection (which is usually the last pasted text), not in the whole document. Alex |
#2
|
|||
|
|||
![]()
If you want to clear any outline level from the entire selection, there's no need to use FIND, you maybe just use something like this:
Code:
Selection.Range.ParagraphFormat.OutlineLevel=wdOutlineLevelBodyText
__________________
Backup your original file before doing any modification. Last edited by eduzs; 06-28-2020 at 02:37 AM. |
#3
|
|||
|
|||
![]()
Wonderful, thank you!
Alex |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Clear rows with vba | DIMI | Excel Programming | 3 | 01-30-2020 09:22 AM |
Clear browser history | Venom286 | Outlook | 0 | 04-08-2019 11:17 PM |
Clear old RSS Feeds | eltonlaw | Outlook | 0 | 08-16-2012 07:32 PM |
![]() |
Jaymond Flurrie | Word VBA | 5 | 07-17-2011 05:07 PM |
Holidays--clear all? | markg2 | Outlook | 0 | 11-01-2009 05:57 AM |