locked
Paragraph numbers out-of-sequence in AutoShape text RRS feed

  • Question

  • I am writing a document in Word 2010 that poses several short questions, then discusses the answers in longer narrative format. I am attempting to create a paragraph style for the questions using borders and shading so they stand out visually. I would like to use graphic effects that are not available in the Borders and Shading dialog, though, so I decided to create more visually-rich rectangle AutoShapes and put the text inside each shape. This worked OK, for a while...

    My custom paragraph style is called Question. I created 17 rectangle AutoShapes, added the text of a question to each one, and formatted that text using the custom Question style. Accordingly, I saw the ordered list that I expected. Assume in the example below that the bold text has a nicely formatted rectangle AutoShape around it:

     

    ----------

    Question 1: What is your name?

    Some long narrative answer for question 1.

    .

    .

    Question 17: What is your favorite color?

    Some long narrative answer for question 17.

    ----------

     

    Eventually, I realized that I needed to insert a new question in the middle of the document. So, I created a new rectangle AutoShape, added the text of the new question inside the rectangle, and formatted the text using my custom Question paragraph style. Unfortunately, the paragraph numbering picked up with the next highest number - 18 - rather than the appropriate number based on the text's position in the document:

     

    ----------

    Question 1: What is your name?

    Some long narrative answer for question 1.

    Question 18: What is your quest?

    Hey, wait; this should be Question 2, not Question 18!

    .

    .

    Question 17: What is your favorite color?

    Some long narrative answer for question 17.

    ----------

     

    I've tested this using a variety of workflows, and find that Word 2010 will number the paragraph based on the order in which the containing AutoShape was created, rather than based on the position of the AutoShape within the document.

    In this case, all of my AutoShapes use the In line with text layout, so Word should be able to correctly interpret their relative positions within the document and assign paragraph numbers correctly.

    Note also that if I use the same paragraph style, Question, to format normal body text outside of the AutoShapes, the paragraphs are renumbered correctly as I add/delete/move the questions around.

    My question is:

    • How can I make Word 2010 assign numbers to paragraphs contained within an AutoShape correctly (i.e. based on their position within the document, not on the order in which I created the AutoShapes)

    Thank you, in advance, for your help.


    • Edited by manniongeo Wednesday, December 21, 2011 7:31 PM
    Wednesday, December 21, 2011 7:29 PM

All replies

  • Numbering within shapes (or text boxes) is based on the relative position of the shape (text box) anchors. To see anchors in the text, display nonprinting marks, for example by pressing the ¶ button on the Home tab, and then click inside a shape. What you need to do is drag the anchors so that these are in the correct order, with respect to numbering.

    Stefan Blom, Microsoft Word MVP
    Wednesday, December 21, 2011 10:19 PM
  • Thanks for your reply, Stefan.

    Unfortunately, the behavior I am observing is different than what you describe. Per the original post, I'm using the In line with text layout. With this layout, the anchors aren't visible. So, just to be sure, I changed the layout to In front of text in order to view the anchor positions with the little anchor symbols.

    With the anchor symbols on, I verified visually that the upper-most AutoShape on the page had an anchor near the top, and that the bottom-most AutoShape had an anchor near the bottom. Still, when I applied my numbered paragraph style, the text in the top-most rectangle was labeled Question 2, because I added that AutoShape to the document second.

    No matter how I rearrange either the AutoShapes or their anchors on the page, the paragraph numbers are always numbered according to the order in which the AutoShapes were created.

    Am I doing something wrong here?

    Thursday, December 22, 2011 10:18 PM
  • Sorry, I missed the part where you said that the shapes were "In line with text." You are right, in such a case the numbers should be correct.

    Just to be clear, you did remember to update the numbering after you rearranged the items? The quickest way is switching to the Backstage view and back to your favorite view (Ctrl+F2 followed by ESC).

    Also make sure you aren't putting a shape inside a drawing canvas, which might also affect numbering.


    Stefan Blom, Microsoft Word MVP
    Friday, December 23, 2011 11:28 AM
  • Hi,

    No matter how I rearrange either the AutoShapes or their anchors on the page, the paragraph numbers are always numbered according to the order in which the AutoShapes were created.

    yes, there have always been problems with text boxes. Instead you can use frames, but then you will not be able to apply special effects. So a solution could be to use SEQ fields instead of automatic numbering. But you have to update fielda by switching to print preview, or manually by selection text and pressing F9, or by using a macro.


    Greetings from Germany
    Lisa [MVP Word]

    • Proposed as answer by Stefan BlomMVP Friday, December 23, 2011 6:39 PM
    Friday, December 23, 2011 3:52 PM
  • "Lisa Wilke-Thissen [MVP]" wrote in message news:b8c705e7-8f44-409c-a1ec-ca307d639630@communitybridge.codeplex.com...
     
    yes, there have always been problems with text boxes. Instead you can use frames, but then you will not be able to apply special effects. So a solution could be to use SEQ fields instead of automatic numbering. But you have to update fielda by switching to print preview, or manually by selection text and pressing F9, or by using a macro. 
     
     
     
     
     
    For some reason I assumed, in my first reply, that this was captions with SEQ field numbers, and obviously I continued along the lines of that assumption. :-(
     
    Indeed, it is correct that paragraph numbering is not a good idea for text boxes/shapes.

    Stefan Blom, Microsoft Word MVP
    Friday, December 23, 2011 4:14 PM
  • Sorry for my delay in replying; I'm just getting back to work after the end-of-year holidays.

    Firstly, thank you both, Stefan and Lisa, for taking the time to reply. Based on the information you've provided, I have decided to go back to using a plain-old paragraph style, outside of the AutoShapes. This makes for a slightly uglier document, but the numbering works properly now.

    The reason I chose to eliminate the AutoShapes is, primarily, because I don't have a good understanding of the difference between paragraph numbering and SEQ field numbering. I'd like to know more, but haven't been able to figure it out on my own yet. Before I ask a more specific question, allow me to provide a bit of context.

    I do understand (at least somewhat) how to:

    • Create paragraph styles, using the Numbering and Bullets dialog to create sequential numbers (e.g. for chapters)
    • View (SHIFT+F9), edit, and update (F9) field codes

    I did some reading on the SEQ field, based on Lisa's response above. From the Word 2010 help, I learned that captions use the SEQ field. So, I took a look at the field code for one of my existing captions and, as expected, it contained a SEQ field.

    Next, I tried to view the field code for one of my numbered paragraph styles. I selected the whole paragraph and used SHIFT+F9 to view the field codes, but numbered paragraphs don't appear to use field codes in the same way as captions. Specifically, I can't select the paragraph number itself and, in turn, cannot reveal its field code (if it even has one). From experimenting a bit more, it seems that numbered lists and multilevel lists behave the same way as paragraphs.

    This brings me to my first question:

    QUESTION1: Can you provide a reference where I can learn more about the internals of how paragraph/list numbering works - ideally, one that compares paragraph numbers to field codes?

     

    In addition to my limited conceptual understanding of numbering, I am also unclear as to how to implement the proposed solution using SEQ fields. I can create a SEQ field and manually insert them into an AutoShape using Insert > Text > QuickParts > Field. This does, indeed, number the text in the AutoShapes correctly, provided that I use F9 to update the fields periodically.

    What I haven't figured out, however, is to create a paragraph style that automatically inserts the SEQ field for me. It's cumbersome to manually add and configure a SEQ field each time I need one. I'd much prefer the convenience and stability (i.e. lack of typos in field codes) of just picking a style form the Styles list that includes the SEQ field, like I currently do for my paragraph styles. Therefore:

    QUESTION 2: Is it possible to create a paragraph style that automatically adds a SEQ field for me?

    For example, when I pick my Question style from the Styles list, I'd like it to add a "prefix" to the paragraph, like the bold text below:

    Question {SEQ question}: Here's the body of my paragraph in non-bold text

    Thank you, again, for your time, and for your continued help.

    Friday, January 6, 2012 6:42 PM
  • Briefly, SEQ field numbers allow you to create single-level numbering anywhere in a document, while auto numbering lets you create a multilevel list (stored as a so-called list template in the Word object model) with up to nine levels of numbering. SEQ fields give you more control, but, on the other hand, you can’t save SEQ fields to a style for easy application.
     
    However, you can reuse SEQ fields if you create an example field, with any leading and trailing text, select the whole thing, and then create a Building Block. Insert the Building Block whenever you want that particular number.
     
    The word.mvps.org site has an explanation of Word’s numbering, but note that not everything may be technically correct in recent versions of Word and the new XML-based file formats. If you are interested in the article anyway, take a look at http://word.mvps.org/faqs/numbering/wordsnumberingexplained.htm.

    Stefan Blom, Microsoft Word MVP
    Saturday, January 7, 2012 2:42 PM