Advertisement

05.20.2007 at 08:56AM PDT, ID: 22583405
[x]
Attachment Details

Determine if a range contains a table of contents in MS Word VBA

Asked by PatternNut in Visual Basic Programming, Microsoft Word

Tags: contains, range, vba

Hi Experts,

Is there a better way to test if a range contains a table of contents?

At the moment I determine the start and end paragraphs of the table of contents using:

    intStartIndex = doctesting.Range(0, doctesting.Indexes(1).Range.Start).Paragraphs.Count
    intEndIndex = doctesting.Range(0, doctesting.Indexes(1).Range.End).Paragraphs.Count

I store those values... then when I have my range I count the paragraphs up to that range:

          rngParaCheck.SetRange Start:=doctesting.Content.Start, End:=rng.Start
          lngCurrentParagraph = rngParaCheck.Paragraphs.Count

Every single line in the above is a bit of a drag on the system.  Is there a better way to tell if a range is within a table of contents / table of figures, etc?

Thanks,

PatternNut
Start Free Trial
[+][-]05.20.2007 at 11:51AM PDT, ID: 19123782

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Basic Programming, Microsoft Word
Tags: contains, range, vba
Sign Up Now!
Solution Provided By: GrahamSkan
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.20.2007 at 01:39PM PDT, ID: 19123995

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2007 at 02:17PM PDT, ID: 19124101

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2007 at 02:24PM PDT, ID: 19124118

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2007 at 02:50PM PDT, ID: 19124187

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.25.2007 at 03:54PM PDT, ID: 19160329

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.27.2007 at 05:24PM PDT, ID: 19165669

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.28.2007 at 02:31AM PDT, ID: 19166680

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32