cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic table of content

ptc-1178444
Newbie

Dynamic table of content

I have tried to use hyperlinks in the past to navigate long documents but as documents grow it becomes more and more painful to generate the multiple links to jump from one region of interest to another.

Here is a possible alternative: The attached document shows how to use region tags and scriptable components to create a dynamic document table of content (TOC) for the entire document.

Each time we want a region to show up in the TOC we just need to set its Tag property. Tags can be filtered to identify plots, sections, etc.

Note that I'm using a regular hyperlink to jump back to the TOC. This could of course be accomplished using a scriptable button.

Xavier
18 REPLIES 18

Dynamic table of content

Very slick example. A useful one too. Now I can spend days going back through old worksheets and putting in tables of contents 😉

Richard

Dynamic table of content

Xavier,
your dynamic TOC is very useful.
Many thanks.

Dynamic table of content

Lovely TOC.
In my case, ... not capable of writing
items in the list box. Well I hate scripting
the scriptable objects.
I must see an example, step by step.

Dynamic table of content

The way you add or remove items from the list box is by setting or clearing the Tag property (right-click, properties) of objects (regions, plots, text regions,...). Then refresh the list and hopefully the new objects show up in the listbox.

Xavier

Dynamic table of content

Nifty! Have you ever tried to use the Web Templates feature to make an external TOC for a Web site? Perhaps not as "automagic" as this, but addresses a similar need. The attached .zip is also available from the downloads section on mathcad.com.

Note, you'll need to understand a little Javascript to be able to see how these work.

Dynamic table of content

Dear Xavier,

I really appreciate the time and effort that you and others put into the forums. I noticed the following in your script:

For each rg in Worksheet.Regions
If rg.Tag <> "" Then
ListBox.AddString( rg.Tag & " -> " & RegionType( rg.Type ) )
End If
Next

.Type is not a documented property (in MCAD 11 guides). Tag, X, and Y are the only documented properties that I could find. Am I correct? The reason I ask is that I am interested in opening "generic" OLE objects from MCAD. MCAD is aware of the OLE component, can I get a "pointer" to the OLE object from MCADs automation or scripting interface? In short, are there other undocumented (or documented) methods or properties that would allow me to locate all the OLE objects in an MCAD doc and open them or access their automation interface.

Thanks for your help.

Sincerely,
Travis Mooney

Dynamic table of content

On 5/6/2005 4:18:34 PM, travlmo wrote:

>.Type is not a documented
>property (in MCAD 11 guides).
>Tag, X, and Y are the only
>documented properties that I
>could find. Am I correct?

Yes. See this thread for other undocumented properties:

http://collab.mathsoft.com/read?40044,12

>The reason I ask is that I am
>interested in opening
>"generic" OLE objects from
>MCAD. MCAD is aware of the
>OLE component, can I get a
>"pointer" to the OLE object
>from MCADs automation or
>scripting interface?

You can crete an instance of any COM object using the VBscript command CreateObject.

> In
>short, are there other
>undocumented (or documented)
>methods or properties that
>would allow me to locate all
>the OLE objects in an MCAD doc

If you have Excel, go into the VB editor. Then go to "tools", "references". This shows you most of what is available on your system. Check any you are interested in, for example "Mathcad Automation 1.0 Type Library". You can look at the properties and methods of any referenced object by going to "view", "object browser".

If you have a specific need for an object, look for free (or even not free!) ActiveX controls on the web. There are very many of them available. Some of these can be called using CreateObject, others can be inserted directly into the worksheet as scripted components.

Richard


Dynamic table of content

Travis,

I think Richard covered all the bases there.

Xavier

Dynamic table of content

I've been using this script in my documents for a long time now. Today I found that tagged regions within closed areas are not read by the script. Not sure if that's new to v14 M030, or if I just haven't noticed this behavior all along.

Just thought I'd share this word of caution.

Thanks,
Preston

Dynamic table of content

Nothing new. It's always been that way. I've complained to Mathsoft (now PTC), but have no idea if they noticed.
__________________
� � � � Tom Gutman

Dynamic table of content

Its proably because they confuse the two types of "locking".

1. is "lock but can open (and copy)"
2. is "locked and sealed (can't open)"

The tags should be invisible for 2. but visible for 1.

Type 1. is used in design manuals, where the source is configuration managed, but you do want folk to copy stuff.

The distinction has long been a confusion.

Philip Oakley

Dynamic table of content

I just logged this issue.

Mona

Re: Dynamic table of content

I realise this is an old post, but I am relatively new to Mathcad and need to set up a dynamic table of content. I cannot seem to link to the original document to uploaded. Do you perhaps still have it and if so I would appreciate it very much if you would let me have it please.

Thanks

Barend

Re: Dynamic table of content

I have just created a new thread which will hopefully attract a bit of interest and provide a few alternatives.

http://communities.ptc.com/thread/52955

Re: Dynamic table of content

For whatever it may be worth, find attached the two attachments (first from Xavier, second from Guest(deleted user))

Re: Dynamic table of content

I can't see any Mathcad worksheet in the second attachment.

Re: Dynamic table of content

Mike Armstrong wrote:

I can't see any Mathcad worksheet in the second attachment.

Neiter do I. It was the attachment of the post http://communities.ptc.com/message/125282#125282 by a user who was either deleted or anonymous by the time I draw the backup. I included it for completeness sake.

Find attached a printout of the topic "Dynamic table of content" (including attachments) in the conference "Programming in Mathcad" as we saw in in the old collaboraty.

Re: Dynamic table of content

Cheers for the information.

I'm sure I came across this in the old forum

Announcements