Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2014, 02:06 AM
Jo 4x4 Jo 4x4 is offline Inputting a number into word in a specific format Windows 7 64bit Inputting a number into word in a specific format Office 2010 64bit
Novice
Inputting a number into word in a specific format
 
Join Date: Jul 2014
Location: South Africa
Posts: 4
Jo 4x4 is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 07-18-2014, 05:02 AM
Charles Kenyon Charles Kenyon is offline Inputting a number into word in a specific format Windows 7 64bit Inputting a number into word in a specific format Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,124
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

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
Attached Images
File Type: png 00 deleteme.png (15.3 KB, 19 views)
File Type: png 01 deleteme.png (15.6 KB, 19 views)
Reply With Quote
  #3  
Old 07-18-2014, 09:32 PM
macropod's Avatar
macropod macropod is offline Inputting a number into word in a specific format Windows 7 32bit Inputting a number into word in a specific format Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #4  
Old 07-18-2014, 10:03 PM
Jo 4x4 Jo 4x4 is offline Inputting a number into word in a specific format Windows 7 64bit Inputting a number into word in a specific format Office 2010 64bit
Novice
Inputting a number into word in a specific format
 
Join Date: Jul 2014
Location: South Africa
Posts: 4
Jo 4x4 is on a distinguished road
Default

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
Reply With Quote
  #5  
Old 07-18-2014, 11:04 PM
macropod's Avatar
macropod macropod is offline Inputting a number into word in a specific format Windows 7 32bit Inputting a number into word in a specific format Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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.
Attached Files
File Type: zip DataEntry.zip (32.0 KB, 10 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 07-19-2014, 12:19 AM
Jo 4x4 Jo 4x4 is offline Inputting a number into word in a specific format Windows 7 64bit Inputting a number into word in a specific format Office 2010 64bit
Novice
Inputting a number into word in a specific format
 
Join Date: Jul 2014
Location: South Africa
Posts: 4
Jo 4x4 is on a distinguished road
Default

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
Reply With Quote
  #7  
Old 07-19-2014, 12:32 AM
macropod's Avatar
macropod macropod is offline Inputting a number into word in a specific format Windows 7 32bit Inputting a number into word in a specific format Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #8  
Old 07-19-2014, 12:45 AM
Jo 4x4 Jo 4x4 is offline Inputting a number into word in a specific format Windows 7 64bit Inputting a number into word in a specific format Office 2010 64bit
Novice
Inputting a number into word in a specific format
 
Join Date: Jul 2014
Location: South Africa
Posts: 4
Jo 4x4 is on a distinguished road
Default

Thanks Paul!!!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inputting a number into word in a specific format 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 a number into word in a specific format 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
Inputting a number into word in a specific format Applying specific format to doc jrodriguez Word 3 07-23-2012 08:38 PM
Inputting a number into word in a specific format Word DOC(X) help - Export to specific format question. archerman Word 3 12-28-2010 11:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft