Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-05-2013, 04:16 PM
macropod's Avatar
macropod macropod is offline Replace each heading with a unique numeric value Windows 7 64bit Replace each heading with a unique numeric value Office 2010 32bit
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

You can do this with a fairly simple macro:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Prgrph As Paragraph, i As Long, Rng As Range
For Each Prgrph In ActiveDocument.Paragraphs
  If Prgrph.Style Like "Heading #" Then
    i = i + 1
    Set Rng = Prgrph.Range
    Rng.End = Rng.End - 1
    Rng.Text = 10000 + i
  End If
Next
Application.ScreenUpdating = True
End Sub

__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
headings numeric



Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace each heading with a unique numeric value How to add space between heading number and heading text Dr Wu Word 4 07-15-2018 03:52 AM
Replace each heading with a unique numeric value How to Restore Heading 1, Heading 2, etc. within a Word Document cheech1981 Word 9 01-11-2017 02:14 AM
Challenging Heading Edit with Find Replace binar Word 10 12-23-2012 08:16 PM
Replace each heading with a unique numeric value Macro to replace one specific heading style with another ubns Word VBA 44 09-04-2012 08:17 PM
Replace each heading with a unique numeric value Styles: Heading 4 stuck at same heading number Hallet Word 1 05-31-2012 02:37 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:29 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