How to insert multiple field codes to same field in MS Word?

0

I am trying to achieve following numbering scheme for a loooon word document:

[Section 1]

[formula] (1.1)

[formula] (1.2)

[formula] (1.3)

[Section 2]

[formula] (2.1)

[formula] (2.2)

[formula] (2.3)

etc. Basically, in each section, I need to number formulas automatically, with the section number in the beginning and the formula number in that section after that. Second number in the parantheses should get resetted in the beginning of each section.

I've been trying to insert the section number and a SEQ label into one single field, without success. Any idea how to achieve this?

P.S. I'm ok with resetting the second number manually in the beginning of each section, if necessary.

SercioSoydanov

Posted 2018-08-19T10:06:22.377

Reputation: 115

Answers

2

You need to use a Multilevel list with Heading levels. The Sections could be Heading 1 and the formula entries one of the other levels such as Heading 2 or 3. For a resource on how to create a multilevel list here is a link to an article "How to create numbered headings ..." if you'd rather not use the link do a web search on ShaunaKelly.Com and then look for the article.

Based on your added comments ...

A multilevel list can be setup to be Right Justified. You do it by Right Justifying the custom paragraph styles, and on the List Dialog where you assign each list level to one of your custom paragraphs, you also set the Right Justification on the Level Symbol.

If you still don't wish to use a custom Multilevel List. Then an alternative is to use SECTION and SEQ field codes. Based on your example from your question they would look like this:

({ SECTION }.{ SEQ  mylist \r1 })

({ SECTION }.{ SEQ  mylist \n })

Hopefully you know that the curly brackets must be entered using the keyboard shortcut of Ctrl + F9.

The field code switches on the SEQ field tell the field to either restart numbering at 1 or to continue the numbering from the previous entry.

You could set these two entries as AUTOCORRECT entries and assign the first one a name such as =Seq1 and when entered on the first entry in a new document section, it would restart the numbering at 1. Then an AUTOCORRECT entry on the second one (the one with the /n switch), given a name such as =Seg2 you would insert on all subsequent entries in the document section.

One final alternative is to simply use only the second AUTOCORRECT entry I've provided, the one that inserts the ({ SECTION }.{ SEQ mylist \n }) string. With this, all entries would be properly set for each document section but their sub number scheme would be continuous. What you would create then is a custom macro that when executed would search the document for the sequence fields and set the first one found in a section with the restart numbering switch.

Rich Michaels

Posted 2018-08-19T10:06:22.377

Reputation: 2 009

Thanks, but what I need is not multilevel list headings. I already use them in my document. What I need is to be able to number the formulas that I put to the document. They require a seperate sequential numbering than the headings. – SercioSoydanov – 2018-08-19T13:52:40.227

Then you still need a multilevel list, but setup you own unique paragraph styles such as MySection (list level 1) and MyFormula (list level 2). The article I referenced still applies for how to do this, but instead of linking a Heading style to a level you link your custom paragraph styles. – Rich Michaels – 2018-08-19T13:58:16.563

That makes sense, except I need to be able to place the numbering arbitrarily on the page. I will use them mostly right-aligned, but along with a lot of things in the row. I believe lists dictates that numbers exist in the left of the page (please correct me if I'm wrong). Besides, I might want to use fields for other purposes too, so I really need to do it with the fields, not lists. – SercioSoydanov – 2018-08-19T14:38:20.667

@SercioSoydanov, I've edited the answer and provided additional alternatives. – Rich Michaels – 2018-08-20T19:01:54.237

Just what I needed. Thanks a lot! After all, a dot between the codes is all that I needed. Do you have any reference that dot is documented as the concatenation operator? – SercioSoydanov – 2018-08-20T19:19:56.803

@SercioSoydanov the dot separates the two fields, it does not concatenate them. It could have been any character, even a space. – Rich Michaels – 2018-08-20T23:22:18.297

So, is there any method that would let me concatenate two field blocks nested into another one? Like so: { { SECTION } & { SEQ label } } – SercioSoydanov – 2018-08-21T03:54:43.703