sata
asked on
Error 5552 "The selection does not consist of heading levels"
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.AddFromRa nge _
doc.Sections(secCounter).R ange
Next secCounter
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.AddFromRa
doc.Sections(secCounter).R
Next secCounter
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That will apply Heading 1