Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 41
  • Last Modified:

Automatic paragraph numbering

Does anyone know how I can change the dots into automatic paragraph numbering.  I use macros in this document for Q. and A. indented to that position.  I would like paragraph numbering to be entered at each "Q." at the 1" margin where the dots are.  See file attached for example.  I use Word 2013.  Do I have to enter automatic page numbering when creating my macros?  No clue.

Thanks!
0
Lise Trottier
Asked:
Lise Trottier
  • 2
2 Solutions
 
GrahamSkanCommented:
The question is a little confusing.

What dots?

Paragraph numbering is done by clicking on one of the Numbering buttons in the Paragraph group on the Home tab.

Page numbering is separate from paragraph numbering and is done via the Page number button in the Header & Footer group on the Insert tab.

Recorded macros are intended to copy what the user does while recording. They do not produce the best code. For instance they don't know why you did a particular action. You would need an 'If' statement for that.
0
 
xtermieCommented:
So you want something like
Q1 question1 text
A1 answer1 text

Q2 question2 text
A2  answer2 text

No example posted

you can do this with the following macro
Sub replaceteext()
counter = 0
For Each par In ActiveDocument.Paragraphs
For Each myStoryRange In ActiveDocument.StoryRanges
    counter = counter + 1
    With myStoryRange.Find
        .Text = "Q."
        .Replacement.Text = "Q" & counter
        .Wrap = wdFindContinue
        .ClearFormatting
        .Replacement.ClearFormatting
        .Replacement.Highlight = False
        .Execute Replace:=wdReplaceOne
    End With
Next myStoryRange
Next par

counter = 0
For Each par In ActiveDocument.Paragraphs
For Each myStoryRange In ActiveDocument.StoryRanges
    counter = counter + 1
    With myStoryRange.Find
        .Text = "A."
        .Replacement.Text = "A" & counter
        .Wrap = wdFindContinue
        .ClearFormatting
        .Replacement.ClearFormatting
        .Replacement.Highlight = False
        .Execute Replace:=wdReplaceOne
    End With
Next myStoryRange
Next par
End Sub

Open in new window

better to adjust your initial macro to do this, if you post us the example
0
 
xtermieCommented:
Good comments and options provided but no feedback by the author
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now