B
Bo Rasmussen
Hi,
I have a document that contain a lot of sections. Each section starts with
an 4 characte identifier, which I would like to extract. Now I would like to
iterate through the sections, but receive a compiler error (wrong number of
arguments)
Dim oSection As Section
Dim oRange as Range
For Each oSection In ActiveDocument.Sections
oRange = oSection.Range(0, 4) 'This is not accepted by compiler
oRange = oSection.Range() 'This is accepted by compiler
Next oSection
'This is also OK
Set oRange = ActiveDocument.Range(0, 4)
What is the difference between the Range object returned by a Section and
that returned by ActiveDocument. And what should I actually iterate through
the sections?
Kind regards
Bo Rasmussen
I have a document that contain a lot of sections. Each section starts with
an 4 characte identifier, which I would like to extract. Now I would like to
iterate through the sections, but receive a compiler error (wrong number of
arguments)
Dim oSection As Section
Dim oRange as Range
For Each oSection In ActiveDocument.Sections
oRange = oSection.Range(0, 4) 'This is not accepted by compiler
oRange = oSection.Range() 'This is accepted by compiler
Next oSection
'This is also OK
Set oRange = ActiveDocument.Range(0, 4)
What is the difference between the Range object returned by a Section and
that returned by ActiveDocument. And what should I actually iterate through
the sections?
Kind regards
Bo Rasmussen