A family of Microsoft word processing software products for creating web, email, and print documents.
re. an equivalent for your SUBSTITUTE expression in Word, there isn't one in the "Field Language", primarily because the Field language does not have any functions like MID, LEFT, INSTR etc. To get string manipulation facilities you basically have to use a DATABASE field connected to a data source that supports an SQL dialect with those kinds of functions. Having a DATABASE field is overkill IMO, and also requires that you have an external file in a known place, which tends to make distribution of documents difficult. It's also "Windows desktop ord only" as Mac Word cannot connect to any such data source. But if you want to pursue that, you could look at the files I posted at http://goo.gl/EYxYij in response to a rather different problem and adapt it for your needs. (Sorry, the problem in there is different enough that it might not be obvious how to adapt the code, but in essence you need to start with a field that looks like
{ QUOTE { DATABASE \d "the database pathname" \s "SELECT '{ STYLEREF 3 \n }'" } }
and use string and logical functions to split the heading number apart and reconstruct it. The total length of the SQL string cannot exceed 255 or perhaps 511 characters but I would think that would be enough in this case.
If your heading numbering is such that your x.y.z numbers never have y > 9 or z > 9 and "." is the decimal point in your locale and the associated Heading 2 paragraph is always present, I think you can probably get "x.y+1.z" using something like the following:
{ QUOTE { =INT{ STYLEREF 2 \s #0.0 }) }{ =.1+{ STYLEREF 2 \s #.0 } #.0 }{ ={ STYLEREF 3 \s #0.0 }-{ STYLEREF 2 \s #0.0 } #.0 } }
(Not seriously tested!)
That relies on a bit of weirdness in Word's { = } field where it will treat x.y.z as if it is x.y+.z. IN my view it's not such a great idea to rely on what is basically a Word kludge. If y or z can go beyond 9, there is a problem because .1 is arithmetically the same as .10 and so on, so you would then start having to use tests such as { IF { STYLEREF 2 \n } = "*0" } to determine whether "y" is .1 or .10, .2 or 20 and so on, and the same to determine whether z is .1 or .10. I would guess it can be done but I haven't pursued that myself.