Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-16-2021, 01:26 AM
macropod's Avatar
macropod macropod is offline Macro to select Headings of ALL styles Windows 10 Macro to select Headings of ALL styles Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

For example:


Code:
Sub DeleteHeadings()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument.Content.Find
  .ClearFormatting
  .Format = True
  .Text = "^12"
  .Replacement.Text = "^&"
  .Replacement.Style = wdStyleNormal
  .Wrap = wdFindContinue
  .Replacement.ClearFormatting
  .Text = ""
  .Replacement.Text = ""
  For i = 1 To 9
    .Style = "Heading " & i
    .Execute Replace:=wdReplaceAll
  Next i
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
heading styles selection



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to get Styles to move headings. Balliol Word Tables 0 10-12-2019 01:24 PM
Macro to select Headings of ALL styles Applied Styles to Headings in Multi-Level List; now ALL second level headings are 1.XX NNL Word 1 08-09-2017 02:52 PM
Macro to select Headings of ALL styles Help with Styles - What is +Body and +Headings spdoffice Word 8 12-18-2016 11:15 PM
Macro to select Headings of ALL styles Creating new styles and applying numbering to headings - numbering not following from headings Fuzzyflo Word 1 07-26-2016 04:34 AM
Headings and Styles. Balliol Word 2 07-26-2013 12:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:44 PM.


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