Create reset from field button without unprotecting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,

Look for some macro code to create a form field reset button without the
user unprotecting the form.

Many thanks in advance.

Steve
 
Hi Steve

The essential code is:

object.UnProtect Password:=YourPassword
object.Protect Type:=wdAllowOnlyFormFields, Password:=YourPassword
where 'object' is your document (eg ActiveDocument)

Cheers
 
Thanks for your response.

Is this correct?

The form is password protected, the user does not know the password. I want
to create a tool bar button where by clicking the button it refreshes /
resets the form fields without the need for 1. entering the password (which
they don't know) to reset. 2. Closing the document and opening again. I've
created the button, just need the code.

Steve

macropod said:
Hi Steve

The essential code is:

object.UnProtect Password:=YourPassword
object.Protect Type:=wdAllowOnlyFormFields, Password:=YourPassword
where 'object' is your document (eg ActiveDocument)

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Steve said:
Hi there,

Look for some macro code to create a form field reset button without the
user unprotecting the form.

Many thanks in advance.

Steve
 
The user doesn't need to know the password (though for anyone familiar with
Word the password would not prove an obstacle). The macro provides the
password both to unlock and relock the form.

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Thanks for your response.

Is this correct?

The form is password protected, the user does not know the password.
I want to create a tool bar button where by clicking the button it
refreshes / resets the form fields without the need for 1. entering
the password (which they don't know) to reset. 2. Closing the
document and opening again. I've created the button, just need the
code.

Steve

macropod said:
Hi Steve

The essential code is:

object.UnProtect Password:=YourPassword
object.Protect Type:=wdAllowOnlyFormFields, Password:=YourPassword
where 'object' is your document (eg ActiveDocument)

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Steve said:
Hi there,

Look for some macro code to create a form field reset button
without the user unprotecting the form.

Many thanks in advance.

Steve
 
Sorry Graham, i'm missing something here?

ActiveDocument.UnProtect Password:=YourPassword
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, Password:=YourPassword

Steve

Graham Mayor said:
The user doesn't need to know the password (though for anyone familiar with
Word the password would not prove an obstacle). The macro provides the
password both to unlock and relock the form.

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Thanks for your response.

Is this correct?

The form is password protected, the user does not know the password.
I want to create a tool bar button where by clicking the button it
refreshes / resets the form fields without the need for 1. entering
the password (which they don't know) to reset. 2. Closing the
document and opening again. I've created the button, just need the
code.

Steve

macropod said:
Hi Steve

The essential code is:

object.UnProtect Password:=YourPassword
object.Protect Type:=wdAllowOnlyFormFields, Password:=YourPassword
where 'object' is your document (eg ActiveDocument)

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Hi there,

Look for some macro code to create a form field reset button
without the user unprotecting the form.

Many thanks in advance.

Steve
 
Sorted it:

ActiveDocument.UnProtect Password:="YourPassword"
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, Password:="YourPassword"



Graham Mayor said:
The user doesn't need to know the password (though for anyone familiar with
Word the password would not prove an obstacle). The macro provides the
password both to unlock and relock the form.

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Thanks for your response.

Is this correct?

The form is password protected, the user does not know the password.
I want to create a tool bar button where by clicking the button it
refreshes / resets the form fields without the need for 1. entering
the password (which they don't know) to reset. 2. Closing the
document and opening again. I've created the button, just need the
code.

Steve

macropod said:
Hi Steve

The essential code is:

object.UnProtect Password:=YourPassword
object.Protect Type:=wdAllowOnlyFormFields, Password:=YourPassword
where 'object' is your document (eg ActiveDocument)

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Hi there,

Look for some macro code to create a form field reset button
without the user unprotecting the form.

Many thanks in advance.

Steve
 
After the form is reset using the following code i wish the tab order to be
reset too, ie. goto text1 on reset.

ActiveDocument.Unprotect Password:="123"
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, Password:="123"

Thanks

Steve

Graham Mayor said:
The user doesn't need to know the password (though for anyone familiar with
Word the password would not prove an obstacle). The macro provides the
password both to unlock and relock the form.

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Thanks for your response.

Is this correct?

The form is password protected, the user does not know the password.
I want to create a tool bar button where by clicking the button it
refreshes / resets the form fields without the need for 1. entering
the password (which they don't know) to reset. 2. Closing the
document and opening again. I've created the button, just need the
code.

Steve

macropod said:
Hi Steve

The essential code is:

object.UnProtect Password:=YourPassword
object.Protect Type:=wdAllowOnlyFormFields, Password:=YourPassword
where 'object' is your document (eg ActiveDocument)

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Hi there,

Look for some macro code to create a form field reset button
without the user unprotecting the form.

Many thanks in advance.

Steve
 
Do mean something like
ActiveDocument.FormFields("Text1").Select
?

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
After the form is reset using the following code i wish the tab order
to be reset too, ie. goto text1 on reset.

ActiveDocument.Unprotect Password:="123"
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, Password:="123"

Thanks

Steve

Graham Mayor said:
The user doesn't need to know the password (though for anyone
familiar with Word the password would not prove an obstacle). The
macro provides the password both to unlock and relock the form.

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Thanks for your response.

Is this correct?

The form is password protected, the user does not know the password.
I want to create a tool bar button where by clicking the button it
refreshes / resets the form fields without the need for 1. entering
the password (which they don't know) to reset. 2. Closing the
document and opening again. I've created the button, just need the
code.

Steve

:

Hi Steve

The essential code is:

object.UnProtect Password:=YourPassword
object.Protect Type:=wdAllowOnlyFormFields, Password:=YourPassword
where 'object' is your document (eg ActiveDocument)

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Hi there,

Look for some macro code to create a form field reset button
without the user unprotecting the form.

Many thanks in advance.

Steve
 
Yep, thanks again Graham.

Graham Mayor said:
Do mean something like
ActiveDocument.FormFields("Text1").Select
?

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
After the form is reset using the following code i wish the tab order
to be reset too, ie. goto text1 on reset.

ActiveDocument.Unprotect Password:="123"
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, Password:="123"

Thanks

Steve

Graham Mayor said:
The user doesn't need to know the password (though for anyone
familiar with Word the password would not prove an obstacle). The
macro provides the password both to unlock and relock the form.

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Steve wrote:
Thanks for your response.

Is this correct?

The form is password protected, the user does not know the password.
I want to create a tool bar button where by clicking the button it
refreshes / resets the form fields without the need for 1. entering
the password (which they don't know) to reset. 2. Closing the
document and opening again. I've created the button, just need the
code.

Steve

:

Hi Steve

The essential code is:

object.UnProtect Password:=YourPassword
object.Protect Type:=wdAllowOnlyFormFields, Password:=YourPassword
where 'object' is your document (eg ActiveDocument)

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Hi there,

Look for some macro code to create a form field reset button
without the user unprotecting the form.

Many thanks in advance.

Steve
 
Back
Top