Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
checkQ checkQ is offline
external usenet poster
 
Posts: 9
Default keybord macro to clear fill in fields on form

I created a fill in form and protected the form with a password. Users are
only allowed to enter fill in data. There are about 36 fields and users find
it laborious when they want to delete info in the fields. They have to select
each field one by one and delete contents.
I tried to assign a keyboard macro to "Clear fields" but the record macro
will not allow me to delete the field while the record macro is running. When
I try to select the form field and press delete all my field formats are
deleted as well.

Does any one know a macro that will clear the contents of more than one form
field at a time without deleting the special formats?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default keybord macro to clear fill in fields on form

If you save the form as a template with the fields empty then new documents
created from it will not have content either.
As for the macro

Sub ClearForm()
Dim oFld As FormFields
Set oFld = ActiveDocument.FormFields
For i = 1 To oFld.Count
If oFld(i).Type = wdFieldFormDropDown Then
oFld(i).Result = " "
Else
oFld(i).Result = ""
End If
Next
End Sub

should do the trick

--

Graham Mayor - Word MVP

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


checkQ wrote:
I created a fill in form and protected the form with a password.
Users are only allowed to enter fill in data. There are about 36
fields and users find it laborious when they want to delete info in
the fields. They have to select each field one by one and delete
contents.
I tried to assign a keyboard macro to "Clear fields" but the record
macro will not allow me to delete the field while the record macro is
running. When I try to select the form field and press delete all my
field formats are deleted as well.

Does any one know a macro that will clear the contents of more than
one form field at a time without deleting the special formats?



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
checkQ checkQ is offline
external usenet poster
 
Posts: 9
Default keybord macro to clear fill in fields on form

Thanks for that macro it works perfectly when I run the macro! But I am still
faced with two problems.

1. When I protect the sheet I cannot run the macro.
2. I would like to assign the macro to a keyboard short cut ie Ctrl+K

When a sheet is protected does it somehow disable the VBA also?

  #4   Report Post  
Posted to microsoft.public.word.docmanagement
checkQ checkQ is offline
external usenet poster
 
Posts: 9
Default keybord macro to clear fill in fields on form

Hi Grayham,
I checked out your website and found the answer that I was looking for under
How to assign a macro to a keyboard hotkey. It worked perfectly even when I
protected the doecument to prevent changes. You are the best!!!



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
Clear form fields when document is protected and more.. [email protected] Microsoft Word Help 4 January 6th 11 10:23 PM
How to create memo form macro that pauses to fill in text? Mary Jane Microsoft Word Help 6 August 9th 07 05:43 PM
repeat form w/ fill-in fields to be used consecutively Katherine Page Layout 2 October 25th 06 07:30 PM
Auto fill Form Fields from previous Variable fields? OmaScott Microsoft Word Help 3 July 19th 06 09:09 PM
formula to calculate form fill-in fields Gib Microsoft Word Help 1 February 5th 05 06:59 AM


All times are GMT +1. The time now is 09:54 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"