Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-19-2015, 04:50 AM
gmayor's Avatar
gmayor gmayor is offline Need to provide numbering to the text Windows 7 64bit Need to provide numbering to the text Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You don't really need a macro for this. Apply the List Number style to the headings. If your document is typical the following will do it.



Code:
Sub AddNumStyle()
Dim oPara As Range
Dim oTable As Table
    For Each oTable In ActiveDocument.Tables
        Set oPara = oTable.Range
        oPara.Collapse 1
        oPara.Start = oPara.Start - 2
        oPara.Collapse 1
        oPara.End = oPara.Paragraphs(1).Range.End
        oPara.Style = "List Number"
    Next oTable
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #2  
Old 01-20-2015, 09:56 AM
preeti preeti is offline Need to provide numbering to the text Windows 7 32bit Need to provide numbering to the text Office 2010 32bit
Novice
Need to provide numbering to the text
 
Join Date: Jan 2015
Posts: 3
preeti is on a distinguished road
Default

Thanks... The Macro worked..

I need an aditional change for the same ,need to add an blank line after each table.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to provide numbering to the text How to provide different formatting in a caption? bantu Word 2 06-28-2014 11:25 PM
How to Create a Reference Style That Will Provide an author (date) citation djwalsh Word 3 03-17-2014 05:28 AM
List Numbering position on right text vanzilz Word 3 02-26-2014 12:45 AM
Numbering issue gap bettween 1.1 and text lower and higer numbering leave no gap Turtlesrun Word 3 02-21-2014 04:48 AM
Using Numbering for Manually Numbered Text gokceng Word 10 09-25-2013 05:02 PM

Other Forums: Access Forums

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