> Dear Experts:
>
[quoted text clipped - 4 lines]
>
> Regards, Andreas
Dim oSection as Section
For Each oSection in ActiveDocument.Sections
If oSection.PageSetup.Orientation = wdOrientationLandscape Then
'it is a landscape section
Else
'it isn't
End If
Next oSection

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
andreas - 06 Aug 2007 20:30 GMT
> > Dear Experts:
>
[quoted text clipped - 18 lines]
> Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> Please reply to the newsgroup
Jonathan,
thank you, it is working
Regards, Andreas
Hi Andreas,
>Is it possible to search for only those section breaks that have got
>LANDSCAPE orientation, using VBA?
hmm..., I think you want to find out
what section breaks cause landscape orientation
in the following section!
The section break, which causes this,
may be in an portrait section however.
You could expand Jonathan's solution
to locate the section break preceeding
the landscape section.
Or you could try this one:
Sub Test555()
Dim rDcm As Range
Set rDcm = ActiveDocument.Range
With rDcm.Find
.Text = Chr(12)
While .Execute
MsgBox rDcm.Characters.Last.Next.PageSetup.Orientation
' 1 = landscape
Wend
End With
End Sub

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
andreas - 06 Aug 2007 20:34 GMT
> Hi Andreas,
>
[quoted text clipped - 33 lines]
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"
Helmut,
it is half working: the section break that features the landscape
orientation is found, but the macro loops 12 times in a document with
three sections.
Regards, Andreas