Reply
 
Thread Tools Display Modes
  #1   Report Post  
lorican lorican is offline
Junior Member
 
Posts: 2
Default Making users fill in the form in Word

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.

Last edited by lorican : August 20th 08 at 04:11 PM
  #2   Report Post  
Posted to microsoft.public.word.newusers
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Making users fill in the form in Word

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" wrote in message ...

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


  #3   Report Post  
lorican lorican is offline
Junior Member
 
Posts: 2
Default

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?


Quote:
Originally Posted by macropod[_2_] View Post
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]

--

Last edited by lorican : August 21st 08 at 08:50 AM
  #4   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Making users fill in the form in Word

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]

--



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Users can't fill in fields in protected form brigit_jones Microsoft Word Help 1 July 10th 08 09:04 AM
How do I create a form for users to fill in in Word or Excel Forms/Tables Page Layout 1 August 4th 06 10:30 PM
i want to automate a form in word. one that users can fill out in BiliG21 Microsoft Word Help 1 July 6th 06 08:57 PM
Repeating field in a form (when users fill it in) Ruth Microsoft Word Help 1 July 5th 06 01:02 PM
How to protect a form and allow users to fill in blank? Warren Microsoft Word Help 2 November 20th 05 05:02 PM


All times are GMT +1. The time now is 11:49 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"