Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Bruce Bruce is offline
external usenet poster
 
Posts: 54
Default Word if...then statement using merge field = invalid Merge field?

Hi,

I am performing a mailmerge from within the Pegasus Opera II System. This
calls on Word for the mailmerge and you finish it off in there. In the
Pegasus software you set up custome fields. These are then available to
select when you set up the mail merge field. I have a field called Cat. It
could have4 predefined catalogues depending on selection.
In the merge document I used the if statement to say that if the field = a
specific name, then make a X in the box. I have 4 of these on the document
each for a different caqtalogue.
When I run the merge, it pops up an error message Invalid Merge Field: This
merge field is used in the main document, but it does not exist in the
datasourse. I have options to remove the field, or replace with a field from
a drop down which only give AutoMergeFields and then OK or cancel.
If I click on the cancel continuously, the merge comes up and the if
statement did what it was suppose to do.
Problem is if I have a 100 documents to send, I have to click 12 times per
document, equating to a 1200 click. Time consuming.
Any ideas please

Regards,

Bruce Kidd

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Word if...then statement using merge field = invalid Merge field?

Which version of Word is this? And do you know exactly what data source
the Word document is connecting to? (It sounds as if Pegasus may be
generating something then connecting the word document to it).

I am surprised that you are only seeing AutoMergeField names listed but
the merge still functions correctly with other field names.


Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Bruce wrote:
Hi,

I am performing a mailmerge from within the Pegasus Opera II System. This
calls on Word for the mailmerge and you finish it off in there. In the
Pegasus software you set up custome fields. These are then available to
select when you set up the mail merge field. I have a field called Cat. It
could have4 predefined catalogues depending on selection.
In the merge document I used the if statement to say that if the field = a
specific name, then make a X in the box. I have 4 of these on the document
each for a different caqtalogue.
When I run the merge, it pops up an error message Invalid Merge Field: This
merge field is used in the main document, but it does not exist in the
datasourse. I have options to remove the field, or replace with a field from
a drop down which only give AutoMergeFields and then OK or cancel.
If I click on the cancel continuously, the merge comes up and the if
statement did what it was suppose to do.
Problem is if I have a 100 documents to send, I have to click 12 times per
document, equating to a 1200 click. Time consuming.
Any ideas please

Regards,

Bruce Kidd

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Bruce Bruce is offline
external usenet poster
 
Posts: 54
Default Word if...then statement using merge field = invalid Merge fie

This happens on my system in Word 2007 and at my customer in Word 2003. Not
sure what the data source is?? Pegasus OII is written in Visual Foxpro 9 if
that is what you are looking for.
It should not work, but once I clicked on the cancel button - 3x for each
merge field in the if statements - it is correct. As soon as I take the If
statement out, the document has no problem.

Thanks for responding, I have been struggeling with this for weeks.


Bruce Kidd



"Peter Jamieson" wrote:

Which version of Word is this? And do you know exactly what data source
the Word document is connecting to? (It sounds as if Pegasus may be
generating something then connecting the word document to it).

I am surprised that you are only seeing AutoMergeField names listed but
the merge still functions correctly with other field names.


Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Bruce wrote:
Hi,

I am performing a mailmerge from within the Pegasus Opera II System. This
calls on Word for the mailmerge and you finish it off in there. In the
Pegasus software you set up custome fields. These are then available to
select when you set up the mail merge field. I have a field called Cat. It
could have4 predefined catalogues depending on selection.
In the merge document I used the if statement to say that if the field = a
specific name, then make a X in the box. I have 4 of these on the document
each for a different caqtalogue.
When I run the merge, it pops up an error message Invalid Merge Field: This
merge field is used in the main document, but it does not exist in the
datasourse. I have options to remove the field, or replace with a field from
a drop down which only give AutoMergeFields and then OK or cancel.
If I click on the cancel continuously, the merge comes up and the if
statement did what it was suppose to do.
Problem is if I have a 100 documents to send, I have to click 12 times per
document, equating to a 1200 click. Time consuming.
Any ideas please

Regards,

Bruce Kidd


  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Word if...then statement using merge field = invalid Merge fie

1. if you can go into Edit Recipient List on the Mailings tab and
a. see what filename is in the Data Source box at the bottom left
b. see what column names are at the top of the list.

2. Can you show us exactly what you are putting in your IF field? (Also,
are all the field brace pairs the sort you enter using ctrl-F9, not the
ones you can type on the keyboard.)

3. Can you verify that these fields appear to work without problems if
you put them directly inside your document rather than nested inside an IF ?

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Bruce wrote:
This happens on my system in Word 2007 and at my customer in Word 2003. Not
sure what the data source is?? Pegasus OII is written in Visual Foxpro 9 if
that is what you are looking for.
It should not work, but once I clicked on the cancel button - 3x for each
merge field in the if statements - it is correct. As soon as I take the If
statement out, the document has no problem.

Thanks for responding, I have been struggeling with this for weeks.


Bruce Kidd



"Peter Jamieson" wrote:

Which version of Word is this? And do you know exactly what data source
the Word document is connecting to? (It sounds as if Pegasus may be
generating something then connecting the word document to it).

I am surprised that you are only seeing AutoMergeField names listed but
the merge still functions correctly with other field names.


Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Bruce wrote:
Hi,

I am performing a mailmerge from within the Pegasus Opera II System. This
calls on Word for the mailmerge and you finish it off in there. In the
Pegasus software you set up custome fields. These are then available to
select when you set up the mail merge field. I have a field called Cat. It
could have4 predefined catalogues depending on selection.
In the merge document I used the if statement to say that if the field = a
specific name, then make a X in the box. I have 4 of these on the document
each for a different caqtalogue.
When I run the merge, it pops up an error message Invalid Merge Field: This
merge field is used in the main document, but it does not exist in the
datasourse. I have options to remove the field, or replace with a field from
a drop down which only give AutoMergeFields and then OK or cancel.
If I click on the cancel continuously, the merge comes up and the if
statement did what it was suppose to do.
Problem is if I have a 100 documents to send, I have to click 12 times per
document, equating to a 1200 click. Time consuming.
Any ideas please

Regards,

Bruce Kidd

  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Bruce Bruce is offline
external usenet poster
 
Posts: 54
Default Word if...then statement using merge field = invalid Merge fie

1. a. The file name here is C:\WINDOWS\TEMP\_2QZ0L1D44.DOC
b. The 4 merge fields that I am looking for each has a column in here.

2. This is the if statement. I am using the CTL F9 for the brackets -
{IF{MERGEFIELD Cat1}="Motion Comps Handbook" "X" ""}.

3. The field in the merge Cat1 is the one I am having trouble with. If I
just use this field in the merge and not have it in an if statement it works
fine.

Where you look at the column heading there is no information or lines in,
just the headings.

Thanx










v

"Peter Jamieson" wrote:

1. if you can go into Edit Recipient List on the Mailings tab and
a. see what filename is in the Data Source box at the bottom left
b. see what column names are at the top of the list.

2. Can you show us exactly what you are putting in your IF field? (Also,
are all the field brace pairs the sort you enter using ctrl-F9, not the
ones you can type on the keyboard.)

3. Can you verify that these fields appear to work without problems if
you put them directly inside your document rather than nested inside an IF ?

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Bruce wrote:
This happens on my system in Word 2007 and at my customer in Word 2003. Not
sure what the data source is?? Pegasus OII is written in Visual Foxpro 9 if
that is what you are looking for.
It should not work, but once I clicked on the cancel button - 3x for each
merge field in the if statements - it is correct. As soon as I take the If
statement out, the document has no problem.

Thanks for responding, I have been struggeling with this for weeks.


Bruce Kidd



"Peter Jamieson" wrote:

Which version of Word is this? And do you know exactly what data source
the Word document is connecting to? (It sounds as if Pegasus may be
generating something then connecting the word document to it).

I am surprised that you are only seeing AutoMergeField names listed but
the merge still functions correctly with other field names.


Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Bruce wrote:
Hi,

I am performing a mailmerge from within the Pegasus Opera II System. This
calls on Word for the mailmerge and you finish it off in there. In the
Pegasus software you set up custome fields. These are then available to
select when you set up the mail merge field. I have a field called Cat. It
could have4 predefined catalogues depending on selection.
In the merge document I used the if statement to say that if the field = a
specific name, then make a X in the box. I have 4 of these on the document
each for a different caqtalogue.
When I run the merge, it pops up an error message Invalid Merge Field: This
merge field is used in the main document, but it does not exist in the
datasourse. I have options to remove the field, or replace with a field from
a drop down which only give AutoMergeFields and then OK or cancel.
If I click on the cancel continuously, the merge comes up and the if
statement did what it was suppose to do.
Problem is if I have a 100 documents to send, I have to click 12 times per
document, equating to a 1200 click. Time consuming.
Any ideas please

Regards,

Bruce Kidd




  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Word if...then statement using merge field = invalid Merge fie

Hi Bruce,

At the very least, you need a space after the '='. Other than that, the field code looks OK.

In your first post, you said "If I click on the cancel continuously, the merge comes up and the if statement did what it was suppose
to do". As posted, though, the IF test couldn't work correctly. The only reason I can see that you would get an 'Invalid Merge
Field' message is that the mergefield was mis-named (eg Cat1 instead of Cat_1).

--
Cheers
macropod
[Microsoft MVP - Word]


"Bruce" wrote in message ...
1. a. The file name here is C:\WINDOWS\TEMP\_2QZ0L1D44.DOC
b. The 4 merge fields that I am looking for each has a column in here.

2. This is the if statement. I am using the CTL F9 for the brackets -
{IF{MERGEFIELD Cat1}="Motion Comps Handbook" "X" ""}.

3. The field in the merge Cat1 is the one I am having trouble with. If I
just use this field in the merge and not have it in an if statement it works
fine.

Where you look at the column heading there is no information or lines in,
just the headings.

Thanx










v

"Peter Jamieson" wrote:

1. if you can go into Edit Recipient List on the Mailings tab and
a. see what filename is in the Data Source box at the bottom left
b. see what column names are at the top of the list.

2. Can you show us exactly what you are putting in your IF field? (Also,
are all the field brace pairs the sort you enter using ctrl-F9, not the
ones you can type on the keyboard.)

3. Can you verify that these fields appear to work without problems if
you put them directly inside your document rather than nested inside an IF ?

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Bruce wrote:
This happens on my system in Word 2007 and at my customer in Word 2003. Not
sure what the data source is?? Pegasus OII is written in Visual Foxpro 9 if
that is what you are looking for.
It should not work, but once I clicked on the cancel button - 3x for each
merge field in the if statements - it is correct. As soon as I take the If
statement out, the document has no problem.

Thanks for responding, I have been struggeling with this for weeks.


Bruce Kidd



"Peter Jamieson" wrote:

Which version of Word is this? And do you know exactly what data source
the Word document is connecting to? (It sounds as if Pegasus may be
generating something then connecting the word document to it).

I am surprised that you are only seeing AutoMergeField names listed but
the merge still functions correctly with other field names.


Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Bruce wrote:
Hi,

I am performing a mailmerge from within the Pegasus Opera II System. This
calls on Word for the mailmerge and you finish it off in there. In the
Pegasus software you set up custome fields. These are then available to
select when you set up the mail merge field. I have a field called Cat. It
could have4 predefined catalogues depending on selection.
In the merge document I used the if statement to say that if the field = a
specific name, then make a X in the box. I have 4 of these on the document
each for a different caqtalogue.
When I run the merge, it pops up an error message Invalid Merge Field: This
merge field is used in the main document, but it does not exist in the
datasourse. I have options to remove the field, or replace with a field from
a drop down which only give AutoMergeFields and then OK or cancel.
If I click on the cancel continuously, the merge comes up and the if
statement did what it was suppose to do.
Problem is if I have a 100 documents to send, I have to click 12 times per
document, equating to a 1200 click. Time consuming.
Any ideas please

Regards,

Bruce Kidd



  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Bruce Bruce is offline
external usenet poster
 
Posts: 54
Default Word if...then statement using merge field = invalid Merge fie

Hi,

The spaces are correct. Might not be in here. I have tried everything with
the mergefield, but now it has stuffed my system up totally.
The mergefield is definitely not misnamed. The software does that and I do
not have to specify the mergenames anywhere.
The fact that the specified fields work if it is not in an IF statement,
shows me that it is correct.
The ony issue is the IF statement.
Whe I enter the IF I actually use the system to complete the IF, I do not
even type it in myself, so am expecting it to be corret. This is in WORD 2007
and the same appears in WORD 2003.
I am baffled and now am getting OLE exception errors when I load my merge.
I think the software creates a temporary database everytime that you call on
the mailmerge in C:\Windows\Temp.

Bruce


"macropod" wrote:

Hi Bruce,

At the very least, you need a space after the '='. Other than that, the field code looks OK.

In your first post, you said "If I click on the cancel continuously, the merge comes up and the if statement did what it was suppose
to do". As posted, though, the IF test couldn't work correctly. The only reason I can see that you would get an 'Invalid Merge
Field' message is that the mergefield was mis-named (eg Cat1 instead of Cat_1).

--
Cheers
macropod
[Microsoft MVP - Word]


"Bruce" wrote in message ...
1. a. The file name here is C:\WINDOWS\TEMP\_2QZ0L1D44.DOC
b. The 4 merge fields that I am looking for each has a column in here.

2. This is the if statement. I am using the CTL F9 for the brackets -
{IF{MERGEFIELD Cat1}="Motion Comps Handbook" "X" ""}.

3. The field in the merge Cat1 is the one I am having trouble with. If I
just use this field in the merge and not have it in an if statement it works
fine.

Where you look at the column heading there is no information or lines in,
just the headings.

Thanx










v

"Peter Jamieson" wrote:

1. if you can go into Edit Recipient List on the Mailings tab and
a. see what filename is in the Data Source box at the bottom left
b. see what column names are at the top of the list.

2. Can you show us exactly what you are putting in your IF field? (Also,
are all the field brace pairs the sort you enter using ctrl-F9, not the
ones you can type on the keyboard.)

3. Can you verify that these fields appear to work without problems if
you put them directly inside your document rather than nested inside an IF ?

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Bruce wrote:
This happens on my system in Word 2007 and at my customer in Word 2003. Not
sure what the data source is?? Pegasus OII is written in Visual Foxpro 9 if
that is what you are looking for.
It should not work, but once I clicked on the cancel button - 3x for each
merge field in the if statements - it is correct. As soon as I take the If
statement out, the document has no problem.

Thanks for responding, I have been struggeling with this for weeks.


Bruce Kidd



"Peter Jamieson" wrote:

Which version of Word is this? And do you know exactly what data source
the Word document is connecting to? (It sounds as if Pegasus may be
generating something then connecting the word document to it).

I am surprised that you are only seeing AutoMergeField names listed but
the merge still functions correctly with other field names.


Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Bruce wrote:
Hi,

I am performing a mailmerge from within the Pegasus Opera II System. This
calls on Word for the mailmerge and you finish it off in there. In the
Pegasus software you set up custome fields. These are then available to
select when you set up the mail merge field. I have a field called Cat. It
could have4 predefined catalogues depending on selection.
In the merge document I used the if statement to say that if the field = a
specific name, then make a X in the box. I have 4 of these on the document
each for a different caqtalogue.
When I run the merge, it pops up an error message Invalid Merge Field: This
merge field is used in the main document, but it does not exist in the
datasourse. I have options to remove the field, or replace with a field from
a drop down which only give AutoMergeFields and then OK or cancel.
If I click on the cancel continuously, the merge comes up and the if
statement did what it was suppose to do.
Problem is if I have a 100 documents to send, I have to click 12 times per
document, equating to a 1200 click. Time consuming.
Any ideas please

Regards,

Bruce Kidd




  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Word if...then statement using merge field = invalid Merge fie

I think something along the following lines must be happening:
a. the software generates a data source document (probably a Word .doc
given the extension, but it doesn't have to be.
b. the software opens your Mail merge main document. But at the point,
what data source is it connected to? For the sake of argument, let's
assume that it is something that does not contain the cat1 fields etc.
c. the software does something to the mail merge main document that
causes the mailmerge field names to be checked.
d. only then does the software connect to the data source that it has
just created, which contains the fields you need.

In step (c) you see the dialog boxes and have to respond to them.

I can replicate most of this in a bit of VBA - my step (c) is a line of
VBA code that updates all the fields in the document body, and
interestingly enough I only see the dialog boxes if the { MERGEFIELD cat
} is inside an IF field, not if it is on its own.

I'm not sure how that squares with what you actually see happening, and
at the moment I haven't tried any workarounds. I suspect that the
problem will occur as soon as the { MERGEFIELD cat } is nested inside
any kind of field.

It's possible that something slightly more complex is going on, e.g.
that the mail merge main document is attached to a Header Source rather
than a Data Source when it is first opened, I haven't checked that
possibility, but if it is to do with that, if you're using Word 2007
it's probably a good idea to try to get rid of header sources.

Other than that, the best you can probably do is to try to identify what
data source and header source your document (and/or perhaps template) is
actually attached to prior to the overall merge process, and/or discover
what the process is attaching the document to during the process, and
fix anything that is static (not generated by the software) so that it
contains the field names you need.

Of course, if the above is /not/ the explanation, that may not do any
good. But it does look as if something along those general lines is
happening.

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Bruce wrote:
Hi,

The spaces are correct. Might not be in here. I have tried everything with
the mergefield, but now it has stuffed my system up totally.
The mergefield is definitely not misnamed. The software does that and I do
not have to specify the mergenames anywhere.
The fact that the specified fields work if it is not in an IF statement,
shows me that it is correct.
The ony issue is the IF statement.
Whe I enter the IF I actually use the system to complete the IF, I do not
even type it in myself, so am expecting it to be corret. This is in WORD 2007
and the same appears in WORD 2003.
I am baffled and now am getting OLE exception errors when I load my merge.
I think the software creates a temporary database everytime that you call on
the mailmerge in C:\Windows\Temp.

Bruce


"macropod" wrote:

Hi Bruce,

At the very least, you need a space after the '='. Other than that, the field code looks OK.

In your first post, you said "If I click on the cancel continuously, the merge comes up and the if statement did what it was suppose
to do". As posted, though, the IF test couldn't work correctly. The only reason I can see that you would get an 'Invalid Merge
Field' message is that the mergefield was mis-named (eg Cat1 instead of Cat_1).

--
Cheers
macropod
[Microsoft MVP - Word]


"Bruce" wrote in message ...
1. a. The file name here is C:\WINDOWS\TEMP\_2QZ0L1D44.DOC
b. The 4 merge fields that I am looking for each has a column in here.

2. This is the if statement. I am using the CTL F9 for the brackets -
{IF{MERGEFIELD Cat1}="Motion Comps Handbook" "X" ""}.

3. The field in the merge Cat1 is the one I am having trouble with. If I
just use this field in the merge and not have it in an if statement it works
fine.

Where you look at the column heading there is no information or lines in,
just the headings.

Thanx










v

"Peter Jamieson" wrote:

1. if you can go into Edit Recipient List on the Mailings tab and
a. see what filename is in the Data Source box at the bottom left
b. see what column names are at the top of the list.

2. Can you show us exactly what you are putting in your IF field? (Also,
are all the field brace pairs the sort you enter using ctrl-F9, not the
ones you can type on the keyboard.)

3. Can you verify that these fields appear to work without problems if
you put them directly inside your document rather than nested inside an IF ?

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Bruce wrote:
This happens on my system in Word 2007 and at my customer in Word 2003. Not
sure what the data source is?? Pegasus OII is written in Visual Foxpro 9 if
that is what you are looking for.
It should not work, but once I clicked on the cancel button - 3x for each
merge field in the if statements - it is correct. As soon as I take the If
statement out, the document has no problem.

Thanks for responding, I have been struggeling with this for weeks.


Bruce Kidd



"Peter Jamieson" wrote:

Which version of Word is this? And do you know exactly what data source
the Word document is connecting to? (It sounds as if Pegasus may be
generating something then connecting the word document to it).

I am surprised that you are only seeing AutoMergeField names listed but
the merge still functions correctly with other field names.


Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Bruce wrote:
Hi,

I am performing a mailmerge from within the Pegasus Opera II System. This
calls on Word for the mailmerge and you finish it off in there. In the
Pegasus software you set up custome fields. These are then available to
select when you set up the mail merge field. I have a field called Cat. It
could have4 predefined catalogues depending on selection.
In the merge document I used the if statement to say that if the field = a
specific name, then make a X in the box. I have 4 of these on the document
each for a different caqtalogue.
When I run the merge, it pops up an error message Invalid Merge Field: This
merge field is used in the main document, but it does not exist in the
datasourse. I have options to remove the field, or replace with a field from
a drop down which only give AutoMergeFields and then OK or cancel.
If I click on the cancel continuously, the merge comes up and the if
statement did what it was suppose to do.
Problem is if I have a 100 documents to send, I have to click 12 times per
document, equating to a 1200 click. Time consuming.
Any ideas please

Regards,

Bruce Kidd


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid Merge Field error John Mailmerge 6 January 27th 09 09:36 PM
Invalid merge field newschapmj1 Mailmerge 2 February 19th 08 09:47 AM
Word: IF statement to merge a field only if another Field is popul HelenC Mailmerge 3 August 24th 06 10:33 AM
how to suppress Invalid Merge Field prompt Francisc Molnar Mailmerge 1 April 4th 06 09:44 AM
suppress invalid merge field word 2003 Mike Mailmerge 3 December 9th 04 11:13 AM


All times are GMT +1. The time now is 11:45 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"