Set tabs in section from macro

A

Alan

Hi

I have a macro that insert a landscape page, but I can't
get the tab setting right on the fotter. My normal footer
has a single tab stop at right hand side of the page
(about 160mm) so my page numbering is right aligned in
the portrait page footer. When I change to landscape I
need to set the tab further out in the footer.

I have the following code which clears all my footer tab
settings:-
With Selection.HeaderFooter
.Range.Paragraphformat.Tabstops.ClearAll
.Range.Paragraphformat.Tabstops.Add Position =
MillimetersToPoints(238), Alignment:=wdAlignTabRight,
Leader:=wdTabLeaderSpaces
End With

This overwrites all my footer tabs.

Can anyone help with how to set the tabs for a particular
section only?

Thanks

Alan
 
D

Doug Robbins - Word MVP

Hi Alan,

Use

With Selection.Sections(1).Footers(wdHeaderFooterPrimary)
.LinkToPrevious = False
.Range.ParagraphFormat.TabStops.ClearAll
.Range.ParagraphFormat.TabStops.Add Position = MillimetersToPoints(238),
Alignment:=wdAlignTabRight, Leader:=wdTabLeaderSpaces
End With

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP
 

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