Format Form Field

M

Michael Coffee

I want to make a form field format to a phone number,
(###) ###-####. i have a fax cover sheet template and
want to only enter in the numbers and have word put in the
dashes and parenthesies. Any help would be greatly
appreciated.

michael
 
C

Charles Kenyon

I suspect you'll need an on-entry macro that will pull up a userform for
this purpose. I'm assuming you are talking about a protected online form. If
not, perhaps a macrobutton field that would pull up such a userform.
 
M

Michael Coffee

It is not an online form, i figured i would have to write
a macro for that. where could i go to get the basics on
writing a macro of this sort, i assume it would be a
relatively simple macro.
 
C

Charles Kenyon

It depends on your definition of relatively simple...

The macro could be as little as:

Sub PhoneNumberMacro()
Dim myForm As frmPhoneNumber
Set myForm = New frmPhoneNumber
myForm.Show
Unload myForm
Set myForm = Nothing
End Sub

Of course, that assumes you have the userform "frmPhoneNumber."

http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

Its all a question of how much work you are willing to go through to help
people type a phone number in a fax form. (You could have the userform
gather all the information for the Fax Cover sheet header just about as
easily. OTOH, you could use macrobutton fields in a table as prompts the way
the built-in fax forms do, or both.)
 
C

Cindy M -WordMVP-

Hi Michael,
I want to make a form field format to a phone number,
(###) ###-####. i have a fax cover sheet template and
want to only enter in the numbers and have word put in the
dashes and parenthesies.
Some versions of Word will do this for you, if you enter the
Format in the form field options. Which version do you have?

Otherwise, you can use a macro that triggers on exit from the
form field. Here's a Knowledge Base article that describes,
generally, how to go about doing this

http://support.microsoft.com?kbid=160988

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 
C

Charles Kenyon

Follow Cindy Meister's link first. It looks a lot simpler. Sorry about that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top