Create expandable topics

G

GREG

HSC,

I have monkeyed around with this idea before. If is a
laborious process and practically every option I have
found required a macro. Macros can sometimes
scare "users" away.

If you want to proceed, I offer up the following
suggestions.

-Open a new document (Lets call it Events). Create a
single column, multi-row table. Hide the borderlines.

-In the first row type something like Event 1 - Outdoor
concert.

-In the second row insert a text box (format it as it
pleases you) and type in the event description. Click
Insert>AutoText>AutoText. In the enter AutoText entries
here window, change the name to Event1. In the look in
window, select the Events file and check OK. Now delete
the text box.

-OK now in the same row that previously contained the text
box, type:
{ IF {DOCVARIABLE ShowHide1} = "Show""{AUTOTEXT Event1}"}

Note: All { } pairs in the above field code are entered
with CTRL+F9

Note: See the following for tips applying macros

http://www.gmayor.com/installing_macro.htm

- Now the macro. You want to apply the following macro to
the document project:

Sub ShowHideEvent1()

Dim toggle As String

Dim err_handler
On Error GoTo err_handler
toggle = ActiveDocument.Variables("ShowHide1").Value
If toggle = "Show" Then
ActiveDocument.Variables("ShowHide1").Value = "Hide"
Else
ActiveDocument.Variables("ShowHide1").Value = "Show"
End If
ActiveDocument.Fields.Update
End
err_handler:
ActiveDocument.Variables.Add Name:="ShowHide1",
Value:="Hide"
Resume

End Sub

- That done, close the VBA project and return to your
document.

- In the first row after the Event title, type the
following all on one line:

MACROBUTTON ShowHideEvent1 "Double-click to show/hide
details

- Select this and press CTRL+F9 (at neat way to create
fields).

- Toggle all of your field codes CTRL+a then ALT+F9 and
then F(.

- If my instructions are accurate (it works here) and you
stuck to the script, you should be able to Double click
the macrobutton and your event description will exand,
double click again and it collaspes.

Repeat for all other events.

Laborious remember.

HTH


-----Original Message-----
I have a need to create a document that will have many
sections on it. I would like to have the user have the
ability to expand a topic that they have interest in. For
example.
(Section Heading) Upcoming Events "The user would click
on this heading and then it would expand the body under it.
 
Top