WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Making users fill in the form in Word

 
   Home -> Office -> New Users RSS
Next:  How do I set up a blank page to do my own letters..  
Author Message
lorican

External


Since: Aug 20, 2008
Posts: 1



(Msg. 1) Posted: Wed Aug 20, 2008 4:01 pm
Post subject: Making users fill in the form in Word
Archived from groups: microsoft>public>word>newusers (more info?)

Hello, I've got a form that I send out to our partners, but the problem
is that more often than not, they return the form not fully completed.
How can I make it that, if they don't fill in part of the form it will
not let them save it? or an 'alert' message will pop up? Various other
companies do similarl things in various online forms, where you can not
submit the form if you have not filled in all the parts. I know there is
also a way of doing it in Excel, but I don't know how. If someone could
tell me how to do it in Word and/or Excel, I'd be very greatful.

Thank you.




--
lorican
Back to top
Login to vote
macropod

External


Since: Jul 02, 2008
Posts: 603



(Msg. 2) Posted: Thu Aug 21, 2008 3:06 am
Post subject: Re: Making users fill in the form in Word [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi lorican,

If you place the following vba code in the 'ThisDocument' module, it will prevent the document being closed if it contains any
formfields that have not been filled in.

Private Sub Document_Close()
Dim oFld As FormField
For Each oFld In ActiveDocument.FormFields
If Trim(oFld.Result) = "" Then
MsgBox "Please complete all the items"
ThisDocument.Reload
Exit Sub
End If
Next aField
End Sub

Note: If the user disables macros upon loading the document or their macro security setting is too high, the code won't work and
they'll be able to close the document without filling in all the formfields.


--
Cheers
macropod
[MVP - Microsoft Word]


"lorican" <lorican.2f1f933.DeleteThis@wordbanter.com> wrote in message news:lorican.2f1f933@wordbanter.com...
>
> Hello, I've got a form that I send out to our partners, but the problem
> is that more often than not, they return the form not fully completed.
> How can I make it that, if they don't fill in part of the form it will
> not let them save it? or an 'alert' message will pop up? Various other
> companies do similarl things in various online forms, where you can not
> submit the form if you have not filled in all the parts. I know there is
> also a way of doing it in Excel, but I don't know how. If someone could
> tell me how to do it in Word and/or Excel, I'd be very greatful.
>
> Thank you.
>
>
>
>
> --
> lorican
Back to top
Login to vote
lorican

External


Since: Aug 21, 2008
Posts: 1



(Msg. 3) Posted: Thu Aug 21, 2008 8:45 am
Post subject: Re: Making users fill in the form in Word [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

thanks for the reply. sadly i'm not very good with advanced word.

I've found 'ThisDocument' module in the 'MicroSoft Objects' folder and
I've copied your marco in to it and clicked on save. To test it, when I
try to close the word document down the macro screen opens up and a
"compile error" message appears. Is that supposed to happen?


'macropod[_2_ Wrote:
> ;359490']Hi lorican,
>
> If you place the following vba code in the 'ThisDocument' module, it
> will prevent the document being closed if it contains any
> formfields that have not been filled in.
>
> Private Sub Document_Close()
> Dim oFld As FormField
> For Each oFld In ActiveDocument.FormFields
> If Trim(oFld.Result) = "" Then
> MsgBox "Please complete all the items"
> ThisDocument.Reload
> Exit Sub
> End If
> Next aField
> End Sub
>
> Note: If the user disables macros upon loading the document or their
> macro security setting is too high, the code won't work and
> they'll be able to close the document without filling in all the
> formfields.
>
>
> --
> Cheers
> macropod
> [MVP - Microsoft Word]
>
> --
>




--
lorican
Back to top
Login to vote
Graham Mayor

External


Since: Jul 04, 2006
Posts: 10974



(Msg. 4) Posted: Thu Aug 21, 2008 2:31 pm
Post subject: Re: Making users fill in the form in Word [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Macropod's macro does have the odd bug, including the use of oFld and aField
to reference the same thing (clearly a typo) but even with that fixed, the
reload function doesn't work as intended.

Take a look at http://www.gmayor.com/formfieldmacros.htm the validation
method shown will not allow you to leave a form field that has not been
filled.

Both methods do, however, require that the user allows any macros saved with
the document to be run, and you cannot rely on that.

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

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


lorican wrote:
> thanks for the reply. sadly i'm not very good with advanced word.
>
> I've found 'ThisDocument' module in the 'MicroSoft Objects' folder and
> I've copied your marco in to it and clicked on save. To test it, when
> I try to close the word document down the macro screen opens up and a
> "compile error" message appears. Is that supposed to happen?
>
>
> 'macropod[_2_ Wrote:
>> ;359490']Hi lorican,
>>
>> If you place the following vba code in the 'ThisDocument' module, it
>> will prevent the document being closed if it contains any
>> formfields that have not been filled in.
>>
>> Private Sub Document_Close()
>> Dim oFld As FormField
>> For Each oFld In ActiveDocument.FormFields
>> If Trim(oFld.Result) = "" Then
>> MsgBox "Please complete all the items"
>> ThisDocument.Reload
>> Exit Sub
>> End If
>> Next aField
>> End Sub
>>
>> Note: If the user disables macros upon loading the document or their
>> macro security setting is too high, the code won't work and
>> they'll be able to close the document without filling in all the
>> formfields.
>>
>>
>> --
>> Cheers
>> macropod
>> [MVP - Microsoft Word]
>>
>> --
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> New Users All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET