In a proper world mintjulep is completely correct. Userforms would in fact be the better route.
First off. When you mention template, you state "opens the template". I hope that is not the case. I hope you are using a template file, and created a new document based on that template - not opening it.
Second, you state it is more of a navigational issue, yet you still ask about hiding stuff. Hiding stuff is not navigation. Navigation is moving around through a document, which is not what you are asking about. So, really, it is NOT a navigational issue. You want to have a document that only has visible elements that reflect specific criteria.
Therefore it is not a navigational issue, it is, at the bottom line, a structural one. Following that thought, a well designed template can be used to
create documents whose structure is based on initial criteria.
Hiding stuff in Word is possible, but it NOT elegant or very efficient. In fact, I rather discourage it. Far better would be to design variable structure into the template.
So where does that leave you? Here. Have the section applicable to all in its own distinct section. It appears you have that already. Good.
Make any sections that are discrete into their own section. This is one route. It is not strictly needed if you use, again as mintjulep suggests, a judicious use of bookmarks, which is what I am also suggesting.
The point being is that if you isolate, by structure, the chunks applicable to choices made in the first section. Then while the
template (i.e. the .DOT) file has ALL chunks, once the user makes the choice in the first section, the
logic derived from that will remove all chunks not applicable.
Do you see why I asked about removing chunks. You did not answer, but IMHO that is the way to go. Although of course I do not know your document. Hiding stuff is kludgey at best in Word. "Showing only" stuff is not what Word does best, or even well. Besides, it is not very good design.
Good design will have all choices in the
template, but only the chosen chunks in the document.
Now, you CAN do this with the first section being in the document, and make the choices there. However, I would prefer to use a UserForm to get the choices from the users. It is more efficient I think, cleaner in the document, and IMHO, more professional looking. A nice well designed dialog form, with lovely choices and buttons. User clicks OK, badda-bing, badda-boom....all sections not applicable to the choice....oudda there! The only thing left is the chunks applicable to the choice.
How do you do that? You can take your current template (and again, hopefully a .DOT file), select each chunks and make it a bookmark. You can select as much text/tables as you like. Select it, and Insert > Bookmark, and give it a name. Say...FinanceManager. Then....WarehouseManager. Whatever. OK, so now they are bookmarked. The chunks.
Using existing checkboxes:
Make an OnExit macro for the checkboxes. Again, good design would use ONE macro for all checkboxes. However, this means well named checkboxes, and I can not assume that. In any case, the OnExit macro for say checkbox FinanceManager would be something like:
Code:
Sub MakeChunks()
Dim strFFName As String
Dim oBM As Bookmark
strFFName = Selection.FormFields(1).Name
ActiveDocument.Unprotect Password:=""
If ActiveDocument.FormFields(strFFName).Result = True Then
For Each oBM In ActiveDocument.Bookmarks()
If oBM.Name <> strFFName Then
oBM.Select
Selection.Delete
End If
Next
End If
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset:=True, Password:=""
End Sub
The above works well if there IS careful naming of both your formfields, AND your bookmarks.
The reason I would prefer to user a UserForm is that it is cleaner to have the logic in the form, rather than in the document itself. Plus, you do not have to deal with formfields - although I love formfields.
Hopefully, this gives you an idea of a (possibly) better design. If you want to get an idea of what I am talking about I could send a file.
Gerry