Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
andreas - 15 Feb 2007 18:20 GMT
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
Doug Robbins - Word MVP - 15 Feb 2007 20:39 GMT
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

Signature

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

>I got a long document in which all sections start with a new page.
> Some of the sections feature the PageSetup Property = Landscape
[quoted text clipped - 8 lines]
>
> Andreas
andreas - 15 Feb 2007 21:54 GMT
On 15 Feb., 21:39, "Doug Robbins - Word MVP" <d...@REMOVECAPSmvps.org>
wrote:
> Dim i As Long
> Dim Msg As String
[quoted text clipped - 32 lines]
>
> - Zitierten Text anzeigen -

Doug, Perfect, Thank you very much.
Regards,

Andreas
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.