Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Tue, 18 Mar 2008 07:44:03 -0700,    group: microsoft.public.word.vba.beginners        back       


Form Fields/Check Boxes   
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
date: Tue, 18 Mar 2008 07:44:03 -0700   author:   Mmay

Re: Form Fields/Check Boxes   
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.

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

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



Mmay wrote:
> 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
date: Fri, 21 Mar 2008 15:19:24 +0200   author:   Graham Mayor

Re: Form Fields/Check Boxes   
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.

"Graham Mayor" wrote:

> 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.
> 
> -- 
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor -  Word MVP
> 
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> 
> 
> 
> Mmay wrote:
> > 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 
> 
> 
>
date: Fri, 21 Mar 2008 12:14:01 -0700   author:   Mmay

Re: Form Fields/Check Boxes   
On Mar 22, 12:19 am, "Graham Mayor"  wrote:
> 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.
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor -  Word MVP
>
> My web sitewww.gmayor.com
> Word MVP web sitehttp://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
> Mmay wrote:
> > 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,

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.
date: Sun, 23 Mar 2008 20:39:35 -0700 (PDT)   author:   Tony Strazzeri

Re: Form Fields/Check Boxes   
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.

"Tony Strazzeri" wrote:

> On Mar 22, 12:19 am, "Graham Mayor"  wrote:
> > 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.
> >
> > --
> > <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> > Graham Mayor -  Word MVP
> >
> > My web sitewww.gmayor.com
> > Word MVP web sitehttp://word.mvps.org
> > <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >
> > Mmay wrote:
> > > 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,
> 
> 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.
> 
>
date: Mon, 24 Mar 2008 05:24:01 -0700   author:   Mmay

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us