What am I doing Wrong: Section Break Protection

B

Brendan

I have a document and at the bottom of page 1, I insterted a "Section Break
(Next Page)". On the Sub_AutoNew, I call the following as per another post
to protect everything above the section ---
ActiveDocument.Sections(1).ProtectedForForms = True --- However, nothing
happens when I open a new document from the template. I know that the
AutoNew is working as I force the user into a bookmark out of the gate.

Another post spoke about going to TOOLS, PROTECT DOCUMENT, and there would
be some prompt box for protecting only sections. The only thing that happens
when I go this route is a popup on the right side of the document appears
with Formatting Restrictions, Editing Restrictions, and Starte Enforcement.

My overall goal is to only protect page 1 as page 2 and so on are open
typing for the user.
 
J

Jezebel

Another post spoke about going to TOOLS, PROTECT DOCUMENT, and there would
be some prompt box for protecting only sections. The only thing that
happens
when I go this route is a popup on the right side of the document appears
with Formatting Restrictions, Editing Restrictions, and Starte
Enforcement.

Check the 'Editing restrictions' checkbox. Select 'Filling in forms' from
the dropdown (which becomes enabled when you check the box). 'Select
sections' will appear beneath the dropdown. Click and select section one.
 
J

Jay Freedman

If you must do this in a macro, you have to set the ProtectedForForms
property for each section -- or at least for those that should *not*
be protected -- and then you also have to turn on the protection:

ActiveDocument.Sections(1).ProtectedForForms = True
ActiveDocument.Sections(2).ProtectedForForms = False
ActiveDocument.Protect Type:=wdAllowOnlyFormFields

The first of these lines is optional, because the .Protect method
assumes that all sections should be protected unless you specifically
state otherwise.

To do it without a macro: First insert at least one section break in
the document (you've already done this). Then open the Protect
Document task pane (what you called a popup, but it isn't that), check
the box under Editing Restrictions, and select "Filling in forms" in
the dropdown. At that time, a blue link "Select sections..." appears
under the dropdown. Click that link to get a dialog where you can
uncheck Section 2.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
B

Brendan

Ok. Where does the section go for protection? At the bottom of page one and
when I use the below code, it protects everything from the insertion point
up? Or does it protect down to the next section break? Also, the section
breaks are NOT labeled so how do I know which one is which if I have numerous
section breaks in a document?
 
J

Jezebel

Ok. Where does the section go for protection? At the bottom of page one
and
when I use the below code, it protects everything from the insertion point
up? Or does it protect down to the next section break? Also, the section
breaks are NOT labeled so how do I know which one is which if I have
numerous
section breaks in a document?

The sections are numbered: one to however many you have. The code protects
whichever section you specify. Select anywhere within the section, and the
section number is shown in the status bar. Or display the document in Normal
view and count them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top