Thanks for your response...
An example of what a field may look like:
{IF { REF subtype1 \* MERGEFORMAT}="d" "" "
If an event of default under paragraph {REF _Ref138149796 \r \h \*
MERGEFORMAT} occurs.....
If....." }
The reference in this case could be to the second paragraph.
In the Word field the paragraphs appear indented indicating that they are
auto-numbered.
The output is always paragraph 1.1.1 (even though its not - once merged it
is say 2.3.12 - it does seem to pick up the number level correctly).
I am using Word's auto numbering with up to 4 levels. There are between 100
and 150 clauses depending upon the user input. I don't want to use manually
typed paragraph numbers.
Re acrobat this is not a problem.
Can't send you any data because this is part of an integrated database
system used for generating single documents using mail merge - i.e. there is
only one record.
Regards
Dave
> I'm not sure this will help, but...
>
[quoted text clipped - 54 lines]
> > through an application that prevents the running of other macros. I am
> > running Word 2003.
> I am using Word's auto numbering with up to 4 levels. There are between
> 100
> and 150 clauses depending upon the user input. I don't want to use
> manually
> typed paragraph numbers.
I have replicated what you have as best I can for experimental purposes, can
see the problem you describe (i.e. where the reference has the para. number
with the correct levels but it always shows 1, 1.1 etc.).
I do not know a way to work around this using IF statements - as far as I
can see, Word generates the correct references for numbered paragraphs
outside the IF statements but not otherwise.
However, you may be able to work around it using a different approach where
you do the numbering using { SEQ } fields instead of using Word's automatic
numbering.
For example, to achieve 4-level 1.2.3.4 numbering, you can use the
following:
Put the following fields at the top of the document:
{ SEQ h1 \r0\h }{ SEQ h2 \r0\h }{ SEQ h3 \r0\h }{ SEQ h4 \r0\h }
Put the following fields at the beginning of each "1" level paragraph:
{ SEQ h1 }{ SEQ h2 \r0\h }{ SEQ h3 \r0\h }( SEQ h4 \r0\h }
Put the following fields at the beginning of each "1.2" level paragraph:
{ SEQ h1 \c }.{ SEQ h2 }{ SEQ h3 \r0\h }( SEQ h4 \r0\h }
Put the following fields at the beginning of each "1.2.3" level paragraph:
{ SEQ h1 \c }.{ SEQ h2 \c }.{ SEQ h3 }( SEQ h4 \r0\h }
Put the following fields at the beginning of each "1.2.3.4" level paragraph:
{ SEQ h1 \c }.{ SEQ h2 \c }.{ SEQ h3 \c }.( SEQ h4 }
For every paragraph you want to reference, select all the SEQ fields in the
para (or at least, the ones that generate visible numbers) and create a
bookmark. For example, for the first numbered paragraph in the document, use
"par1", for the second, use "par2" etc.
When you want to reference another paragraph, say, "par10", use { par10 },
or { REF par10 }
However, when you use this approach, using IF fields with { SEQ } fields
inside will not work properly (in essence, Word calculates the numbers
whether they are used in the document or not). So instead, you will need to
use INCLUDETEXT fields to include the pieces of document you need.
Because of additional problems if you try to use
{ IF a = b "{ INCLUDETEXT this }" "{ INCLUDETEXT that }" }
you really need to use an approach more like
{ INCLUDETEXT "c:\\mypath\\{ IF a = b "this" "that" }" }
where "this" and "that" are the file names you need or
{ INCLUDETEXT "c:\\mypath\\nyfile.doc" "{ IF a = b "this" "that" }" }
where "this" and "that" are bookmark names that cover the appropriate
portions of text in the included document.
(The latter approach that uses bookmarks is likely to work the best).
This approach has its pitfalls, but I think it is at least worth trying -
I'd start with a very simple feasibility tests and increase the complication
if you think it's worth it.
Otherwise, the only approach I know would be to use VBA and/or to generate
the document some other way altogether, e.g. using XML.
Peter Jamieson
cannot find a way to work around it. Basically, i don't think you're going
to be able to do it
> Thanks for your response...
>
[quoted text clipped - 104 lines]
>> > through an application that prevents the running of other macros. I am
>> > running Word 2003.
Dave Shaw - 02 Aug 2006 17:06 GMT
Thanks for the reply its been helpful. I have actually just managed to get
round the problem by using lots of IF fields rather than several paragraphs
all inside one - I used a trial and error approach. This seems to work (at
the moment).
I may consider using SEQ fields as you have suggested for future simpler
document as it does seem to work with the bookmark (which surprised me as I
thought that all bookmarks were lost as soon as the merge was initiated).
(I've never used SEQ fields before but now i've tired it looks like they may
behave better than autonumbers)
Unfortunately using the include text will not work in this occasion as the
document resides on 10 different servers in different locations with
different paths etc for the different offices.
Thanks for your help - much appreciated.
Dave
> > I am using Word's auto numbering with up to 4 levels. There are between
> > 100
[quoted text clipped - 185 lines]
> >> > through an application that prevents the running of other macros. I am
> >> > running Word 2003.