Solved

Automatic paragraph numbering

Posted on 2016-08-25
3
24 Views
Last Modified: 2016-09-16
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
Comment
Question by:Lise Trottier
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 250 total points (awarded by participants)
ID: 41771354
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
 
LVL 17

Assisted Solution

by:xtermie
xtermie earned 250 total points (awarded by participants)
ID: 41771730
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
 
LVL 17

Expert Comment

by:xtermie
ID: 41801194
Good comments and options provided but no feedback by the author
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now