View Single Post
  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Cooz Cooz is offline
external usenet poster
 
Posts: 11
Default How to set the language in form fields?

Hi Graham,

In fact I do use macros with the form. Company policy is that the resulting
document must be available to the user in its entirety, so the macro in the
last form field that the user exits replaces the form fields with their
values and removes the protection.

Since the date format is always "d MMMM yyyy", I have added code that
replaces any English months with their Dutch translations, which yields the
desired result. It's another workaround.

Thank you for your cooperation,

Cooz

"Graham Mayor" wrote:

If you can use macros with your form (I saw your reply to Peter) there is a
workaround that I posted in another forum yesterday that you can apply:

In the following example, the date field is Text1 and the default format is
configured as "d MMMM yyyy" or "dddd, d MMMM yyyy" in the field properties.
The two macros are run on exit and entry to the field as their names imply.
The entry macro clears any date text from the field and prompts for the date
in the format "DD/MM/YY". If the date is entered in the field in this
format, the exit macro formats the field in the indicated language in the
format selected in the field properties. I have inserted both Dutch (active)
and Greek (inactive) to demonstrate that it does in fact work. The entry
macro is not essential as long as you remember to clear the field and type
the date in the format DD/MM/YY before tabbing out of the field.

Sub DateOnExit()
With ActiveDocument.FormFields("text1")
.Range.LanguageID = wdDutch
'.Range.LanguageID = wdGreek
.Result = .Result
End With
End Sub

Sub DateOnEntry()
ActiveDocument.FormFields("text1").Result = ""
MsgBox "Enter date in the format 'DD/MM/YY'"
End Sub

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Cooz wrote:
Hi Graham,

It's been a while - busy me.

Yep, that is the obvious solution, but it doesn't seem to work. When I
applied your suggestion, I found out that the form fields already were
formatted as Dutch. I updated them, and it doesn't make any
difference. The Windows Regional settings are correct, for example
"donderdag 24 september 2009" for today.

However, I just tested your suggestion on my own laptop - and not on a
machine of the company that I'm creating templates for - and it
worked fine. Can this company have forced any policy or setting that
makes my form fields display English dates? Any suggestions?

Thank you, once more,

Cooz


"Graham Mayor" wrote:

With the form unprotected, format the form field with the Dutch
Language - Tools Language. Then update the field. The display will
adopt the settings from the Windows Regional settings Long Date
format for that language.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Cooz wrote:
Hi everyone,

I have a Dutch version of Word 2003, and I work with Dutch texts in
Dutch documents, in which the language is set to Dutch.

I insert a text form field with the type set to Date and the Date
format to "d MMMM", protect the form and type 6-6 in the field. I
press the tab key. The field result is "6 June".

It's English!

What can I possibly do to retrieve Dutch dates?

Thank you,
Cooz