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 / March 2008

Tip: Looking for answers? Try searching our database.

Form Fields/Check Boxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mmay - 18 Mar 2008 15:44 GMT
I am creating a word 2002 form to be used online as a fill-in application for
employment.  I have written the macro below to use on exit for a form field
but would prefer it to work upon editing of the text such as checking yes in
a check box or entering name, address, etc. in a text box.  Also, is there a
way to have the field shading removed upon entry of a form field so that
users will know where they are in the form?
I apply this macro in the form field properties to run on entry currently.
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 3/14/2008 by mmay
'
   ActiveDocument.Unprotect Password:=""
   Selection.Font.Color = wdColorAutomatic
   ActiveDocument.Protect Password:="", NoReset:=True, Type:= _
       wdAllowOnlyFormFields
End Sub
Graham Mayor - 21 Mar 2008 14:19 GMT
What it is that you think your macro is supposed to do?
It doesn't seem to do anything useful that cannot be achieved by formatting
the document.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> I am creating a word 2002 form to be used online as a fill-in
> application for employment.  I have written the macro below to use on
[quoted text clipped - 14 lines]
>        wdAllowOnlyFormFields
> End Sub
Mmay - 21 Mar 2008 20:14 GMT
When a user enters the form online it is protected, this macro automatically
changes the color of the text box font once they exit the field (to help them
keep track of which fields they have answered). I would like my macro to
change the color of the font, only if they edit the information in the text
box and for the background shading to disappear as the field is exited.
This would allow them to track their progress on the form but also make it
easier once it is printed at our company, for the personnel department to
differentiate their responses from the questions.

> What it is that you think your macro is supposed to do?
> It doesn't seem to do anything useful that cannot be achieved by formatting
[quoted text clipped - 18 lines]
> >        wdAllowOnlyFormFields
> > End Sub
Tony Strazzeri - 24 Mar 2008 04:39 GMT
> What it is that you think your macro is supposed to do?
> It doesn't seem to do anything useful that cannot be achieved by formatting
[quoted text clipped - 12 lines]
> > exit for a form field but would prefer it to work upon editing of the
> > text such as checking yes in a check box or entering name, address,

I assume you mean Changing the value.  If this is the case you need to
store the original value of the field/item and then compare that with
the value on exit.  to determine if it has changes.
Where and how you do this will vary depending on whether the form
field is a "Word forms: field",  a control from the control toolbox,
or an activex object. each of these may have a property that can be
"cajoled" (my expression for using something in a way it was not
specifically designed for) into holding the original value.  eg if it
has a Tag property (some VBA forms controls have this) you could store
the original value in that. another may be the default value. etc.

> >  Also, is there a way to have the field shading

No.  The diasplay field shading is an application wide property. When
turned on it works for all fields or none in every document currently
open.

You may be able to do something with a toolbar to show progress by
having a chackbox for each field and setting its value.  However I
think that is more trouble than it would be worth.  if you have that
many fields and keeping track is a problem my siolution would be to
control everything by putting all of the questions in a VBA form that
way you can condense all of the questions into a smaller area, arrange
them appropriately and do error checking as well.  not to mention the
ability to quickly move backwards and forwards.  I also prefer this
method because I can let the user see all of the questions "up-front".

Hope this helps.

Cheers!
TonyS.
Mmay - 24 Mar 2008 13:24 GMT
Thank you, I was afraid I couldn't do anything about the shading but your
suggestion should work great, I don't know why i didn't think about that in
the first place. Just thinking too hard I guess.

> > What it is that you think your macro is supposed to do?
> > It doesn't seem to do anything useful that cannot be achieved by formatting
[quoted text clipped - 44 lines]
> Cheers!
> TonyS.
 
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.