Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELDS
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 |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELDS
Most likely the fields in the document need to be updated.
-- 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 "Nathan Franklin" wrote in message ... 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 |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELDS
Don't know that it matters, but you need a space after IF.
-- 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. "Nathan Franklin" wrote in message ... 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 |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELDS
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"? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Nathan Franklin wrote: 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 |
#5
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELDS
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.... "Graham Mayor" wrote in message ... 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"? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Nathan Franklin wrote: 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 |
#6
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELDS
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 "Nathan Franklin" wrote in message ... 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 |
#7
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELDS
Was the If field constructed using Ctrl+F9 to insert the field delimiters?
-- 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 "Nathan Franklin" wrote in message ... 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 "Nathan Franklin" wrote in message ... 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 |
#8
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELDS
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. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Nathan Franklin wrote: Graham, I do get the value 1 if I just have that mergefield in the doc.... the problem is I need to use IF statements to display the applicable thing based on the value.... I don't get any format errors... But just no value appears when using the if statement... im not sure what to do.... "Graham Mayor" wrote in message ... 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"? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Nathan Franklin wrote: 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 |
#9
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELDS
it was used by inserting the field... (in the Insert menu) and then select
the IF field option... "Doug Robbins - Word MVP" wrote in message ... Was the If field constructed using Ctrl+F9 to insert the field delimiters? -- 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 "Nathan Franklin" wrote in message ... 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 "Nathan Franklin" wrote in message ... 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 |
#10
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELDS
got it sorted
"Nathan Franklin" wrote in message ... it was used by inserting the field... (in the Insert menu) and then select the IF field option... "Doug Robbins - Word MVP" wrote in message ... Was the If field constructed using Ctrl+F9 to insert the field delimiters? -- 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 "Nathan Franklin" wrote in message ... 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 "Nathan Franklin" wrote in message ... 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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Merging data with INSERTTEXT and MERGEFIELDs | Mailmerge | |||
Replace mergefields with form fields | Mailmerge | |||
remove mergefields, keep values | Mailmerge | |||
Mergefields change Format | Mailmerge | |||
Working with Mergefields | New Users |