MessageBox listing all sections with the "PageOrientation = Landscape" property

A

andreas

I got a long document in which all sections start with a new page.
Some of the sections feature the PageSetup Property = Landscape
Can I ask Word via VBA to show me all sections in a MsgBox that
feature this property, such as:

Section 5, 7, 9 have the "PageOrientation = Landscape" property.

Help is appreciated. Thank you very much in advance.

Regards,

Andreas
 
D

Doug Robbins - Word MVP

Dim i As Long
Dim Msg As String
Msg = ""
With ActiveDocument
For i = 1 To .Sections.Count
If .Sections(i).PageSetup.Orientation = wdOrientLandscape Then
Msg = Msg & i & ", "
End If
Next i
End With
Msg = Left(Msg, Len(Msg) - 2) & " have the PageOrientation = Landscape
property."
MsgBox Msg


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
A

andreas

Dim i As Long
Dim Msg As String
Msg = ""
With ActiveDocument
For i = 1 To .Sections.Count
If .Sections(i).PageSetup.Orientation = wdOrientLandscape Then
Msg = Msg & i & ", "
End If
Next i
End With
Msg = Left(Msg, Len(Msg) - 2) & " have the PageOrientation = Landscape
property."
MsgBox Msg

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP








- Zitierten Text anzeigen -

Doug, Perfect, Thank you very much.
Regards,

Andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top