Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Protected Docs and bullets/numbering

Status
Not open for further replies.

ScottH31

Programmer
Jan 17, 2005
6
GB
Hi folks,

Hope you can help me out here. I've got a protected document with certain sections unprotected to allow users to make changes. The problem I'm currently having is that even though they can edit the section text, they cannot use Bullets and Numbering/Bordering and Shading (to name a few) because they're greyed out on the Format menu.

I call a function to allow certain sections to remain editable (SetEditableDocSections doc, EDITABLE_SECTIONS)

and then do doc.Protect wdAllowOnlyFormFields, , PROTECT_PASSWORD

The code for SetEditableDocSections is below.

Function SetEditableDocSections(doc As Document, sSections As String)
Dim sTemp As String
Dim iSectionID As Integer
Dim s As Section
On Error Resume Next

'first, set all sections as protected
For Each s In doc.Sections
s.ProtectedForForms = True
Next

'then set those we want to be unprotected
sTemp = sSections
Do Until sTemp = ""
iSectionID = nnCInt(ParseStr(sTemp, ";"))
If iSectionID > 0 Then
doc.Sections(iSectionID).ProtectedForForms = False
End If
Loop
End Function

It's Word 2002 on XP, all help GREATLY appreciated.

Cheers,

Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top