Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2007

Tip: Looking for answers? Try searching our database.

Formatting Text Input From Dialog Box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J At Work - 30 May 2007 19:00 GMT
I'm revising and consolidating a number of business letters. Most just use
form fields and drop-down menus, but for some of the more complex letters I
have been writing simple macros that run upon selection from a drop-down, ask
the user for a few bits of data, and spit out the relevant sentence or
paragraph.

The problem is that while the form field text can be set up to autoformat, I
haven't been able to figure out how to do the same for the dialog box input.
I just need to convert dialog box inputs in the same manner as form fields,
e.g., 010107 into January 1, 2007, 1234567 into 1-2345-67. These letters will
be used by novice users that are going to get confused if the data formatting
works in one place but doesn't in another.

I am a newbie to VBA but not to coding, and I just can't find any info on
how to forcibly format the dialog box variables so that they "print" in the
correct format. Please help!
Thanks,
J
Cindy M. - 05 Jun 2007 18:14 GMT
Hi =?Utf-8?B?SiBBdCBXb3Jr?=,

> I'm revising and consolidating a number of business letters. Most just use
> form fields and drop-down menus, but for some of the more complex letters I
[quoted text clipped - 12 lines]
> how to forcibly format the dialog box variables so that they "print" in the
> correct format.

You want to convert what the user types, so that it appears formatted while
still in the dialog box? Or just when inserting back into the form document?

The latter will certainly be simpler. For the former you'd need to use one of
the events provided by a textbox control, and getting it "just right" can be
tricky. Best is to use the Exit event (analog to a form field) so that the
formatting code executes when the user moves to the next field.

In either case, you can probably achieve a lot using the Format command. There's
quite a bit in the VBA help, to get you started.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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 :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.