Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-16-2018, 03:17 PM
macropod's Avatar
macropod macropod is offline VBA code to convert Heading 1, 2, 3 etc. numbering Windows 7 64bit VBA code to convert Heading 1, 2, 3 etc. numbering Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,387
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

It seems to me that all you need is:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument.Range.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Text = ""
  .Replacement.Text = ""
  .Forward = True
  .Format = True
  .Wrap = wdFindContinue
  For i = 1 To 4
    .Style = "Heading " & i
    .Replacement.Style = "Schedule Level " & i
    .Execute Replace:=wdReplaceAll
  Next
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Heading not following the correct numbering jongleur Word 2 05-16-2017 10:52 AM
Fixing my heading numbering tomsrv Word 3 08-31-2016 12:17 AM
Unhidden Heading Numbering snmuvz Word 5 02-04-2015 08:01 PM
Heading 3 numbering not working right Dr Wu Word 2 04-02-2013 07:24 AM
VBA code to convert Heading 1, 2, 3 etc. numbering Heading numbering anomaly Ulodesk Word 8 03-19-2012 01:57 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:28 AM.


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