Customizing Word Built-In Dialog Boxes

L

Lynn Taylor

I am showing the Insert Table of Contents dialog box using
VBA. "Dialogs(wdDialogsInsertTableofContents).Show"

When i do this, the Show Levels box has a 9 in it. How
can I change this to 3.

If you perform the same task in Word by clicking on
Insert, Index and Tables then click the TOC tab, the Show
Levels box has a 3 in it.

Any helpers please?
LT
 
J

Jay Freedman

Hi, Lynn,

When you're looking for information about settings in built-in dialogs, the
best reference is -- believe it or not -- the WordBasic help file from Word
95. It's available from a link at
http://word.mvps.org/FAQs/MacrosVBA/WordDlgHelp.htm.

In this case, the InsertTableOfContents dialog has a parameter named .To
that controls the Show Levels box. You can handle it like this:

Dim dlg As Dialog
Set dlg = Dialogs(wdDialogInsertTableOfContents)
With dlg
.To = 3
.Show
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top