Translate a mergefield date into Spanish

P

Patrickw

I have a merge field which inserts a date in the following format:

mmmm d, yyyy

The proper format for a Spanish translation is as follows:

d de mmmm de yyyy

Is there an easy way to get mmmm to display the name of the month in
Spanish with formatting codes?

January = enero
February = febrero
March = marzo
April = abril
May = mayo
June = junio
July = julio
August = agosto
September = septiembre
October = octubre
November = noviembre
December = diciembre

Or a VBA procedure to read the date from the document, then translate
it and paste it back in the same place?

The date appears in the third paragraph of a letter as follows:

If you believe you are not in default, you must call my office
immediately and make an appointment before the 10 days expire. You
must bring proof (cancelled checks) for each and every payment you
have made to <<Creditor_Name>> since {MergeField "IncidentFiled" \@
"MMMM d, yyyy"}. IF YOU DO NOT BRING PROOF OF THESE PAYMENTS WITHIN
10 DAYS OF THE DATE OF <<CREDITOR_NAME>>’S LETTER GIVING YOU NOTICE OF
DEFAULT, I WILL NOT BE ABLE TO HELP YOU.

The Spanish version of the same paragraph is as follows:

Si usted cree que no ha dejado de pagar, usted debe llamar a mi
oficina inmediatamente y haga una cita antes de los 10 días vencerá.
Usted debe traer la prueba (cheques cancelados) para cada uno y cada
pago que haya hecho a <<Creditor_Name>> desde {MergeField
"IncidentFiled" \@ "d de MMMM de yyyy"}. SI NO ME DARLE PRUEBAS DE
SUS PAGOS A <<CREDITOR_NAME>> DENTRO DE 10 DÍAS A PARTIR DE LA FECHA
DE LA CARTA DESDE <<CREDITOR_NAME>> DANDO A USTED AVISO DE
INCUMPLIMIENTO, NO VOY A PODER AYUDAR A USTED.
 
D

Doug Robbins - Word MVP

Use the following field construction:

{MergeField "IncidentFiled" \@ "d"} de { IF {MergeField "IncidentFiled" \@
"M"} = 1 “enero” }{ IF {MergeField "IncidentFiled" \@ "M"} = 2
“febrero” }{ IF {MergeField "IncidentFiled" \@ "M"} = 3 “marzo” }{ IF
{MergeField "IncidentFiled" \@ "M"} = 4 “abril” }{ IF {MergeField
"IncidentFiled" \@ "M"} = 5 “mayo” }{ IF {MergeField "IncidentFiled" \@ "M"}
= 6 “junio” }{ IF {MergeField "IncidentFiled" \@ "M"} = 7 “julio” }{ IF
{MergeField "IncidentFiled" \@ "M"} = 8 “agosto” }{ IF {MergeField
"IncidentFiled" \@ "M"} = 9 “septiembre” }{ IF {MergeField "IncidentFiled"
\@ "M"} = 10 “octubre” }{ IF {MergeField "IncidentFiled" \@ "M"} = 11
“noviembre” }{ IF {MergeField "IncidentFiled" \@ "M"} = 12 “diciembre” } de
{MergeField "IncidentFiled" \@ "yyyy"}

You must use Ctrl+F9 to insert each pair of Field delimiters { }


--
Hope this helps

Doug Robbins - Word MVP
Please reply only to the newsgroups unless you wish to avail yourself of my
services on a paid, professional basis.

I have a merge field which inserts a date in the following format:

mmmm d, yyyy

The proper format for a Spanish translation is as follows:

d de mmmm de yyyy

Is there an easy way to get mmmm to display the name of the month in
Spanish with formatting codes?

January = enero
February = febrero
March = marzo
April = abril
May = mayo
June = junio
July = julio
August = agosto
September = septiembre
October = octubre
November = noviembre
December = diciembre

Or a VBA procedure to read the date from the document, then translate
it and paste it back in the same place?

The date appears in the third paragraph of a letter as follows:

If you believe you are not in default, you must call my office
immediately and make an appointment before the 10 days expire. You
must bring proof (cancelled checks) for each and every payment you
have made to <<Creditor_Name>> since {MergeField "IncidentFiled" \@
"MMMM d, yyyy"}. IF YOU DO NOT BRING PROOF OF THESE PAYMENTS WITHIN
10 DAYS OF THE DATE OF <<CREDITOR_NAME>>’S LETTER GIVING YOU NOTICE OF
DEFAULT, I WILL NOT BE ABLE TO HELP YOU.

The Spanish version of the same paragraph is as follows:

Si usted cree que no ha dejado de pagar, usted debe llamar a mi
oficina inmediatamente y haga una cita antes de los 10 días vencerá.
Usted debe traer la prueba (cheques cancelados) para cada uno y cada
pago que haya hecho a <<Creditor_Name>> desde {MergeField
"IncidentFiled" \@ "d de MMMM de yyyy"}. SI NO ME DARLE PRUEBAS DE
SUS PAGOS A <<CREDITOR_NAME>> DENTRO DE 10 DÍAS A PARTIR DE LA FECHA
DE LA CARTA DESDE <<CREDITOR_NAME>> DANDO A USTED AVISO DE
INCUMPLIMIENTO, NO VOY A PODER AYUDAR A USTED.
 
G

Graham Mayor

While Doug's approach is adventurous, simply formatting the mergefield as
Spanish should suffice. Use the following switch and apply the Spanish
language format to the field.

{ Mergefield DateFieldName \@ "d 'de' MMMM 'de' yyyy" \*charformat}


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

Patrickw

Thanks, guys. Graham, which switch is translating the months into
their Spanish language equivalent?
 
J

Jay Freedman

Patrickw said:
Thanks, guys. Graham, which switch is translating the months into
their Spanish language equivalent?

Patrick,

None of the field switches are for translating. What Graham meant was to
create the field, select the whole field, go to Tools > Language > Set
Language, and select Spanish as the language. If you're inserting the field
into the middle of text that's already formatted as Spanish (not just typed
as Spanish words, but formatted through the Set Language dialog), then the
field will automatically also be formatted as Spanish and you won't have to
do anything to it.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
P

Patrickw

Thanks, Jay. The program generating the merge data won't let me
access VBA until after the merge occurs, so I don't have the
opportunity to change the language until it's too late. Doug's coding
worked perfectly, however. Now my staff doesn't need to manually edit
the Spanish version of the document after it is generated.

And thanks to Graham and Doug. You guys really know your stuff.
 
G

Graham Mayor

If the program creating the merge is creating the merge document then unless
programming is modified to apply the correct language formatting parameters
to the texts inserted then you are right, you will need a sequence of fields
like those that Doug has created, but the fact that you can insert such a
sequence of fields suggests that this is not the case and you do have access
to the merge document, thus you can apply the correct language formatting
before running the merge and avoid the need for such a complexity of fields.
You can make the required language part of the paragraph style applied to
the Spanish texts and fields.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

Patrickw

Graham,

You are right. In my template, I can create a style (call it
SpanishStyle1) based on the normal style, set the language for the
style to Spanish, apply the style to my Spanish language paragraphs
(there is an 'if' field which prints an English version of the letter
if a SpanishSpeaker mergefield is set to 'N' and a Spanish version if
the same mergefield is set to 'Y'). Then I can simply apply the
SpanishStyle1 to all the paragraphs in the Spanish version with the
appropriate switch for dates as you showed in your post above
{ Mergefield DateFieldName \@ "d 'de' MMMM 'de' yyyy" \*charformat).
I didn't know you could set the language for individual paragraph
styles. I was thinking I would have to set the language
programmatically through VBA before the merge took place.

Thanks. Both your solution and Doug's are great. In this particular
case, your solution is easier to implement (a lot less coding), but
Doug's solution is great for anyone needing a course on the proper
syntax for running complex conditional tests on mergefields such as
dates.
 
G

Graham Mayor

Not only styles, you can set the language parameter for each individual
character in the document if you wished, in just the same way that you could
apply bold or underlining.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top