Word Form-Field Capitalization

R

RBM

Is it possible to set up a Word 2002 form field such that sentences beyond
the first one entered into the field begin with a capital letter? I use
fields that contain multiple sentences not infrquently and the first letter
issue is easily tackled with the "First Capital" setting for the first
sentence only. The setting appears not to be carried through to subsequent
settings, however. Any help or pointers appreciated.
 
C

Cindy M -WordMVP-

Hi Rbm,
Is it possible to set up a Word 2002 form field such that sentences beyond
the first one entered into the field begin with a capital letter? I use
fields that contain multiple sentences not infrquently and the first letter
issue is easily tackled with the "First Capital" setting for the first
sentence only. The setting appears not to be carried through to subsequent
settings, however. Any help or pointers appreciated.
About the only thing I can imagine would be a macro that is triggered when
you exit that would go through the form field's text and use UCase on the
first character after every period-space combination... How much text do you
type in these fields? More than 255 characters?

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

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

RBM

Usually less than 255 characters. Why?

Cindy M -WordMVP- said:
Hi Rbm,

About the only thing I can imagine would be a macro that is triggered when
you exit that would go through the form field's text and use UCase on the
first character after every period-space combination... How much text do you
type in these fields? More than 255 characters?

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

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

Cindy M -WordMVP-

Hi Rbm,
Usually less than 255 characters. Why?
Because using VBA activeDocument.Formfields("Name").Result = "the text" balks
when you try to write more than 255 characters into a form field.

In this case, you should be able to do something like this (off the top of my
head):

lPosOld = 1
lPos = 1
Set ffld = ActiveDocument.FormFields("Name")
szFieldContent = ffld.Result
Do
lPos = InStr(lPos, szFieldContent, ". ") + 1
If lPos > 1 Then
szNewContent = szNewContent & _
Mid(szFieldContent, lPosOld, lPos) & _
UCase(Mid(szFieldContent, lPos+1, 1)
lPos = lPos + 1
lPosOld = lPos
End if
Loop While lPos > 1
ffld.Result = szNewContent


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

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

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