View Single Post
  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

There must be a simpler way :-(


Things I can't manage: How to add a custom field (variable) to the
existing mailmerge fields?


You can't add a name to the list of available { MERGEFIELD } type fields
without changing the data source in some way, but you can add "working"
fields by using { SET } fields (which set the values of "bookmarks" and you
can reference them using { REF } fields, e.g.

{ SET myfield 2 }

{ REF myfield } (or, if the name of MYFIELD does not clash with built-in
field types, just { myfield }

You can also set the value of a bookmark using an ASK field, e.g.

{ ASK myfield "Enter a value for myfield" }

If you just want to do this once at the beginning of the merge rather than
for each record merged, use the \o switch:

{ ASK myfield "Enter a value for myfield" \o }

I also can't seem to get field operators (such as + - * ) to work - I
insert a pagenumber field on the page, and a formula field {=PAGE + 1}


In this case you probably need { ={ PAGE }+1 }

where both pairs of {} are inserted using ctrl-F9.

, but the calculated field only updates when I create it, or press F9, but
does not recalculate evry time the page prints.


Yes, it is difficult to work out exactly which fields will be calculated
when you merge and at what point. I certainly do not know what all the rules
are. However, a general principle seems to be that if you use { PAGE } or
{ SECTION } type fields nested inside an { = } field, you have to merge to
an output document then select the fields (e.g. ctrl-A) and re-execute them
(F9). If you merge directly to the printer, the output will probably be
wrong.

I am trying to do a 'merge' for printing a series of pages with sequential
numbers on them, something like a cash slip book.

I need to set up a variable that I can preload with a starting value, and
then have this 'field' appear three or four times on every page, with the
starting number incrementing with every appearance.


You probably need to consider using a { MERGESEQ } field to give you the
record number for each record actually merged and doing something like:

At the beginning of the document...
a. Set the number of sequence numbers per merge record. Suppose there are
3. Things will be difficult if the number varies!:
{ SET count 3 }
b. get the starting sequence number
{ ASK start "Enter the starting sequence number" \o }
c. set up calculations for each sequence number, e.g.

First number: { ={ start }+({ MERGESEQ }-1)*{ count } }

Second number: { ={ start }+1+({ MERGESEQ }-1)*{ count } }

Third number: { ={ start }+2+({ MERGESEQ }-1)*{ count } }

Or you might use something more like

First number: { SEQ mynumber \r{ ={ start }+({ MERGESEQ }-1)*{ count } } }

Second number: { SEQ mynumber }

Third number: { SEQ mynumber }

None of these methods provides a way to remember the last sequence number
used and pick it up for the next merge. There are various ways you could do
that but you would probably need to use VBA: at a certain point you might
find it easier to insert all these numbers using VBA. But let's leave that
for now.

Peter Jamieson

"Willie van Rensburg" wrote in message
...
I am trying to do a 'merge' for printing a series of pages with sequential
numbers on them, something like a cash slip book.

I need to set up a variable that I can preload with a starting value, and
then have this 'field' appear three or four times on every page, with the
starting number incrementing with every appearance.

Currently I am creating an Excel spreadsheet, filling a column with the
required number series, and then mailmerging that.

Things I can't manage: How to add a custom field (variable) to the
existing mailmerge fields?
I also can't seem to get field operators (such as + - * ) to work - I
insert a pagenumber field on the page, and a formula field {=PAGE + 1},
but the calculated field only updates when I create it, or press F9, but
does not recalculate evry time the page prints.

There must be a simpler way :-(

Any assistance much appreciated :-)
--
Willie van Rensburg