Word – In Word 2010, can I hide or show a section of the document whenever the user clicks a hyperlink

hyperlinkmicrosoft-word-2010

I'm trying to make a document that is mainly comprised of a list.

Each list item summarizes the contents of a linked Excel spreadsheet that is currently attached at the end of the document; what I'd like to do is copy each spreadsheet section and paste-special it under the relevant list item and either hide or show it based on the click of a hyperlink, so that I can distribute this document to individual users who can display only those sections relevant to their department and print a customized version of the total report.

Is this possible, or am I trying to use Word for something I'd really need to use HTML/CSS/Javascript for?

Best Answer

I've done this type of document for a large insurance company. We did it by creating custom Word forms.

On the form you create some mechanism for the user to choose their desired document sections. A listbox or series of check boxes would do. When the user fills our their choices, they click a button on the form.

Next you have to write some VBA code. The code either, creates the document dynamically based on their choices or hides the unwanted sections. You can add bookmarks to the document for each segment, then find the bookmark in the document, then set the font to hidden.

It was at least 8 years ago that I did this. Today I'd probably use Visual Studio 2010 and create an Excel document using the Office tmplates.

I'd guess that you will have to write some VBA or .NET code to solve this problem.