A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Word » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Lock language in FORMTEXT



 
 
Thread Tools Display Modes
  #1  
Old September 22nd, 2009, 09:18 PM posted to microsoft.public.word.newusers
John Morris
external usenet poster
 
Posts: 5
Default 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  
Old September 23rd, 2009, 07:41 AM posted to microsoft.public.word.newusers
Graham Mayor
external usenet poster
 
Posts: 18,297
Default 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  
Old September 23rd, 2009, 03:59 PM posted to microsoft.public.word.newusers
John Morris
external usenet poster
 
Posts: 5
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.