View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP on news.microsoft.com Doug Robbins - Word MVP on news.microsoft.com is offline
external usenet poster
 
Posts: 407
Default Mailmerge with "If" statement producing unexpected results

Try doing it without using the AddressBlock field. Instead, just insert the
actual mergefields in the configuration that you want them.

--
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, originally posted via msnews.microsoft.com

"Griffo" wrote in message
...

"Griffo" wrote:

Hi there

I'm using the below code for my mail merge.

Problem is that when there is a "/" in the Street1 or Street2 fields, I
get
a bunch of characters on that line that shouldn't be there.

Can anyone shed any light as to what might be going wrong - I built this
statement by looking around on the net - I'm very much a novice when it
comes
to this stuff.

If it is relevant, I'm using Word 2003 with the data being pulled from an
Excel 2003 spreadsheet.

EDIT - here is the code!

{ if { MERGEFIELD "ShipToName" } = "same as billing" "{ADDRESSBLOCK \F"
_FIRST0__LAST0__SUFFIX0_
_STREET1_
_STREET2_
_CITY_, _STATE_ _POSTAL_" \l 1033 \c 0 \e "" \* UPPER }"

"{MERGEFIELD "ShipToName" \* UPPER }
{ MERGEFIELD "ShipToAddress1" \* UPPER }
{ MERGEFIELD "ShipToAddress2" \* UPPER }
{ MERGEFIELD "ShipToCity" \* UPPER } { MERGEFIELD "ShipToState" \* UPPER }
{ MERGEFIELD "ShipToPostalCode" }"}


Thanks
Griffo