View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
griffo griffo is offline
external usenet poster
 
Posts: 4
Default Mailmerge with "If" statement producing unexpected results


"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