
Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> The button itself works when I put the botton in the text box. But the
> spell
[quoted text clipped - 42 lines]
>> >> > there a way
>> >> > to hide them or not have them show in the print?
No it is all on one line it just gets cut in this forum here. When I mouse
over it it prompts me to add =2 after wdAllowFormFields but that doesn't work
either.
Thanks for your help.
Mike
> Is that code all on one line in the macro? If it is as shown in your
> message you need to add a visual basic carriage return (space+_) after True,
[quoted text clipped - 48 lines]
> >> >> > there a way
> >> >> > to hide them or not have them show in the print?
Doug Robbins - Word MVP - 06 Jan 2006 21:22 GMT
The following certainly works for me
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
Password:="test"
Are you sure that oDoc is referencing a document?

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> No it is all on one line it just gets cut in this forum here. When I
> mouse
[quoted text clipped - 58 lines]
>> >> >> > there a way
>> >> >> > to hide them or not have them show in the print?
Mike Anderson - 07 Jan 2006 00:16 GMT
I tried ActiveDocument instead of the oDoc and it does the same. it stops
right there.
Thank you for your help.
Mike
> The following certainly works for me
>
[quoted text clipped - 65 lines]
> >> >> >> > there a way
> >> >> >> > to hide them or not have them show in the print?
Doug Robbins - Word MVP - 07 Jan 2006 10:35 GMT
Are you sure that in your code you have wdAllowOnlyFormFields and not
wdAllowFormFields? In your post you use both.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I tried ActiveDocument instead of the oDoc and it does the same. it stops
> right there.
[quoted text clipped - 78 lines]
>> >> >> >> > there a way
>> >> >> >> > to hide them or not have them show in the print?
Mike Anderson - 09 Jan 2006 19:31 GMT
Yes I have wdAllowOnlyFormFields. I must have made a typo in one of my
posts. It should be noted that the macro worked fine untill I put it in the
text box.
> Are you sure that in your code you have wdAllowOnlyFormFields and not
> wdAllowFormFields? In your post you use both.
[quoted text clipped - 81 lines]
> >> >> >> >> > there a way
> >> >> >> >> > to hide them or not have them show in the print?
Dawn Crosier - 06 Jan 2006 22:50 GMT
The number 2 is referring to the value of the constant. For
compatibility it is better to refer to the constant rather than the
value, although either will work.
From Help:
WdProtectionType can be one of these WdProtectionType constants.
wdAllowOnlyComments
wdAllowOnlyFormFields
wdAllowOnlyReading
wdAllowOnlyRevisions
wdNoProtection
Regarding why your code will stop running at the protection line. Is
your document protected at that point or is it unprotected?

Signature
Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"
This message is posted to a newsgroup. Please post replies and
questions to the newsgroup so that others can learn as well.
> No it is all on one line it just gets cut in this forum here. When
> I mouse
[quoted text clipped - 70 lines]
>> >> >> > there a way
>> >> >> > to hide them or not have them show in the print?
Mike Anderson - 07 Jan 2006 00:13 GMT
when the code stops and I end it, it is unprotected.
Thanks Mike
> The number 2 is referring to the value of the constant. For
> compatibility it is better to refer to the constant rather than the
[quoted text clipped - 90 lines]
> >> >> >> > there a way
> >> >> >> > to hide them or not have them show in the print?