Solved

Error 5552 "The selection does not consist of heading levels"

Posted on 2004-09-13
2
1,679 Views
Last Modified: 2008-01-09
Hi,

I copied the below codes and tried to run on my word document, but I receive the error "The selection does not consist of heading levels"

Below are the codes. Can someone tell me exactly what's wrong, and what do i need to do? I tried searching for this error in microsoft's web, but can't find anything....

Sub AllSectionsToSubDoc(ByRef doc As Word.Document)
Dim secCounter As Long
Dim NrSecs As Long
NrSecs = doc.Sections.Count
'Start from the end because creating
'Subdocs inserts additional sections
For secCounter = NrSecs - 1 To 1 Step -1
doc.Subdocuments.AddFromRange _
  doc.Sections(secCounter).Range
Next secCounter
0
Comment
Question by:sata
2 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 50 total points
ID: 12052483
The first paragraph of a subdocument should be a heading level.
In outline mode, promote the first paragraph from body text to a heading (left arrow on the outline toolbar)
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 12055870
To supplement what Graham has said - click on the first paragraph or first line and press Alt Control 1.

That will apply Heading 1


0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question