Solved

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

Posted on 2004-09-13
2
1,623 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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Like many others, we try and discourage users from printing documents unnecessarily and instead send or share them electronically. However, this doesn't always work and documents are still printed. With this simple solution, if the user tries to …
Introduction Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other t…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now