textbox alignment

N

Nicky

I use macros to position textboxes aligned with the bottom margin of the page
in Word using

Selection.ShapeRange.Top = wdShapeBottom

However, when the page has footnotes, the macro places the textbox over the
footnote text. Is there any way to write a macro that places the textbox
above the footnote separator on a page with footnotes? I’d guess this might
involve calculating the height of the main text area on a page with
footnotes, in order to calculate a fixed “from top†measure, but can’t wotk
out how to do this.
 
H

Helmut Weber

Hi Nicky,

I wonder, whether there is a more elegant way,
but one could calculate how far form the top of the page
the first paragraph in a footer is, like this:

Dim sPos As Single
sPos =
ActiveDocument.StoryRanges(wdPrimaryFooterStory).Paragraphs(1).Range.Information(wdVerticalPositionRelativeToPage)

(A terribly long line. Beware of linebreakes by the newsreader.)

And in addition you need some kind of offset, like this:

With ActiveDocument.Shapes(1)
sPos = sPos - .Height * 1.55 ' offset
.Top = sPos
End With

HTH

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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