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

15,815

Solution 1

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.

Solution 2

You could use the Word More Add-in ($19.99 with free trial), which adds expandable segments capability to Microsoft Word documents, segments that can also be collapsed/expanded via a VBA macro. A demo Word document is also available for download.

For a discussion of the product see this article :
Insert Collapse / Expand Options In Word Document - More Add-in.

Solution 3

This may be possible with VBA, however I doubt it.

MS Word is a WYSIWYG document editor and is not intended to have a dynamically modifiable display of data. You are correct that web based solutions are better suited for this. You can create a custom webpage/site using HTML,JS, and CSS to accomplish this. However, there many prebuilt web apps for this. There are a lot of exisiting wiki, knowledge base, etc apps already out there that are free to use. This site is free and open source and I think would be better suited to the task than word is.

Share:
15,815
jsnlxndrlv
Author by

jsnlxndrlv

Infrequent programmer and frequent program user. @jsnlxndrlvgooglefacebooklinkedin

Updated on September 18, 2022

Comments

  • jsnlxndrlv
    jsnlxndrlv over 1 year

    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?