Testing for page orientation whilst in headers

R

Roderick O'Regan

I have a document with a number of sections.

Some of those sections might be in landscape.

Each of those sections has a graphic in the header - one kind of
graphic for a portrait page and another for a landscape one.

I easily loop through each of the section headers and remove the
graphic placed in it.

The problem arises when I want to put a new graphic in each of the
headers. Again, one type of graphic for a portrait and another for the
landscape sections.

I want to test, therefore, whilst in a header whether the cursor is
in a landscape or portrait page.
I cannot use the command...
If Selection.PageSetup.Orientation = wdOrientPortrait Then
....because I'm in a header.

Is there a way of checking this, please? Or do I have to first check
in the MainDocument whether I'm in a portrait page, then go into the
header, place the appropriate graphic and then return to the main
document repeating the same procedure for each section?

Regards

Roderick
 
H

Helmut Weber

Hi Roderick,

how about this one:

MsgBox Selection.Sections(1).PageSetup.Orientation

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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