Hello all,
When I do a mail merge with VB, I am trying to update a certain value on my
word document...
It is using an IF field... But on the new merged document it just appears
blank with no value
{ IF{MERGEFIELD PowerConnected } = 1 "Note: Power was connected at time of
inspection." "Note: Power was not connected at time of inspection." }
In the data I am passing PowerConnected does equal 1 ... is there anything
you could suggest....
thanks
Nathan
Doug Robbins - Word MVP - 23 Feb 2006 04:49 GMT
Most likely the fields in the document need to be updated.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Hello all,
>
[quoted text clipped - 11 lines]
>
> Nathan
Charles Kenyon - 23 Feb 2006 04:56 GMT
Don't know that it matters, but you need a space after IF.

Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
> Hello all,
>
[quoted text clipped - 11 lines]
>
> Nathan
Graham Mayor - 23 Feb 2006 07:45 GMT
This should work as you have it. If you merge the document with
{Mergefield PowerConnected}
what result do you get, when you think you should be getting "1"?

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Hello all,
>
[quoted text clipped - 11 lines]
>
> Nathan
Nathan Franklin - 23 Feb 2006 23:13 GMT
Graham,
I do get the value 1 if I just have that mergefield in the doc.... the
problme is I need to use IF statements to display the applicable thing based
on the value.... I dont get any format errors... But just no value appears
when useing the if statement...
im not sure what to do....
> This should work as you have it. If you merge the document with
> {Mergefield PowerConnected}
[quoted text clipped - 15 lines]
>>
>> Nathan
Graham Mayor - 24 Feb 2006 06:51 GMT
In that case I have been unable to reproduce the problem here. I have no
idea why this is not working if you have given us all the pertinent
information.
Have you tried it without your macro, by using the field construction in a
merge document and attaching your data file? If that works, it would suggest
that there is a problem with your vba coding.

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham,
>
[quoted text clipped - 32 lines]
>>>
>>> Nathan
Nathan Franklin - 24 Feb 2006 01:18 GMT
i have an update on this
when putting this into my document
{ IF {MERGEFIELD PowerConnected } = 1 "Note: Power was connected at time of
inspection." "Note: Power was not connected at time of inspection." \*
MERGEFORMAT }
The value that gets printed when I do a mail merge is "PowerConnected"
the actual merge value (i have checked this) is 1.
> Most likely the fields in the document need to be updated.
when and how do I update these fields... before or after the merge??
thanks
nathan
> Hello all,
>
[quoted text clipped - 11 lines]
>
> Nathan
Doug Robbins - Word MVP - 24 Feb 2006 05:07 GMT
Was the If field constructed using Ctrl+F9 to insert the field delimiters?

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>i have an update on this
>
[quoted text clipped - 29 lines]
>>
>> Nathan
Nathan Franklin - 26 Feb 2006 23:39 GMT
it was used by inserting the field... (in the Insert menu) and then select
the IF field option...
> Was the If field constructed using Ctrl+F9 to insert the field delimiters?
>
[quoted text clipped - 31 lines]
>>>
>>> Nathan
Nathan Franklin - 26 Feb 2006 23:57 GMT
got it sorted
> it was used by inserting the field... (in the Insert menu) and then select
> the IF field option...
[quoted text clipped - 36 lines]
>>>>
>>>> Nathan