If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Lock language in FORMTEXT
Hello,
My client is an non-profit internation medical research company doing business in English only. Investigators are required to complete Word 2003 forms which include a date in a text form field. When the forms are returned, the date field is filled in whatever language the investigator has set as their Word default. Could be Russian, Czech, Spanish, French, and so on. Is there any way to set or lock the language in a text field? Selecting the form field, or the whole document, and setting the language has no effect on the languge that shows up in the text field. Sorry if this has been dealt with recently. John Morris |
#2
|
|||
|
|||
Lock language in FORMTEXT
Hmmmm. There are several varieties of English with different date formats,
but assuming you can persuade users to run macros, it is possible to format the date in the variety of English that you prefer. In the following example, the date field is Text1 and the default format is configured as "d MMMM yyyy" in the field properties. The two macros are run on exit and entry to the fields 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 UK English (active) and Greek (inactive) to demonstrate that it does in fact work. Sub DateOnExit() With ActiveDocument.FormFields("text1") .Range.LanguageID = wdEnglishUK '.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 http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org John Morris wrote: Hello, My client is an non-profit internation medical research company doing business in English only. Investigators are required to complete Word 2003 forms which include a date in a text form field. When the forms are returned, the date field is filled in whatever language the investigator has set as their Word default. Could be Russian, Czech, Spanish, French, and so on. Is there any way to set or lock the language in a text field? Selecting the form field, or the whole document, and setting the language has no effect on the languge that shows up in the text field. Sorry if this has been dealt with recently. John Morris |
#3
|
|||
|
|||
Lock language in FORMTEXT
On Wed, 23 Sep 2009 09:41:28 +0300, "Graham Mayor"
wrote: Hmmmm. There are several varieties of English with different date formats, but assuming you can persuade users to run macros, it is possible to format the date in the variety of English that you prefer. In the following example, the date field is Text1 and the default format is configured as "d MMMM yyyy" in the field properties. The two macros are run on exit and entry to the fields 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 UK English (active) and Greek (inactive) to demonstrate that it does in fact work. Sub DateOnExit() With ActiveDocument.FormFields("text1") .Range.LanguageID = wdEnglishUK '.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 http://www.gmayor.com/installing_macro.htm Excellent. It worked perfectly and does exactly what is needed. Thanks for this. John Morris |
Thread Tools | |
Display Modes | |
|
|