#1
|
|||
|
|||
Inputting a number into word in a specific format
Hi everybody. This is probably a simple fix, but I don't know how to do it. I have a template for a certificate where I enter the person's name and Identity number. This Identity number has to be in a specific format IE: yyyymmdd 1234 123 with the spaces . Some of the people using this template to type the numbers in keep on getting it wrong, so I want to "force" the number into that format. Thanks in advance Win 7, Office 2010 |
#2
|
|||
|
|||
I would do this using three separate legacy form fields. This would require that the document be protected for filling in forms, which places severe restrictions on editing.
Those form fields could be formatted the way you want. To do this in Word 2010, I would probably use Greg Maxey's tools. Add Classic FormField Controls to Ribbon I especially appreciate the addition of the classic lock button to the ribbon. Otherwise, it could be done in vba using a UserForm (custom dialog box). Create & Employ a Userform |
#3
|
||||
|
||||
It could also be done with a single content control (or formfield). The content control would require an on-exit macro, but doesn't otherwise require the constraints that come with using formfields.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
Hi guys, thanks, but perhaps I should have explained that I don't know nearly enough about word. Can you please explain that in English?
Thanks Jo |
#5
|
||||
|
||||
See attached. The document uses two content controls - one to solicit the date and another to solicit the remainder of the certificate ID. The formatting of the former is controlled by the content control's formatting and a ContentControlOnExit macro validates the latter.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
Thanks Paul. My problem is that some of the people working with this is not very computer literate. Our Identity numbers is something like 196705221234567. The first part being date of birth. When typed, I would like it to be printed as: 19670522 1234 567, without them needing to place the spaces, and with minimal complications.
Thanks again Jo |
#7
|
||||
|
||||
The use of the two content controls was done to ensure valid data entry. Although one can use the calendar control to pick a date, it's also possible to type one into it (in any valid date format) and let the control re-format it with the YYYYMMDD format as soon as it's exited. Although I haven't implemented it, the ContentControlOnExit macro could also be used to ensure the date entered into this control falls within a valid range (e.g. a date between 1.1.2000 and today).
Similarly, although the second one allows the user to input a number in any format, it will re-format the number to the #### ### format when that content control is exited. The second control's reformatting, and the space between the two content controls delivers the spacing you say you need. All it takes to exit either content control is to press the Tab key or to click anywhere else in the document.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
Thanks Paul!!!
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to format a TOC (level 1) using a number, but have the number hidden in the text | porpoiseoil | Word | 1 | 09-13-2014 12:53 PM |
Inputting 339 supplier names into individual Word documents | Aron19 | Mail Merge | 3 | 04-29-2014 04:41 PM |
Change from General Format to number format | gbaker | Excel | 3 | 08-16-2013 01:04 PM |
Applying specific format to doc | jrodriguez | Word | 3 | 07-23-2012 08:38 PM |
Word DOC(X) help - Export to specific format question. | archerman | Word | 3 | 12-28-2010 11:46 PM |