|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Access the FootnoteSeparator and then return its vertical position relative to page
Hi! Is there a way with a macro of accessing the FootnoteSeparator and then returning its vertical position relative to page? Can someone help? Thanks! |
#2
|
||||
|
||||
You can try this line which seems to work for me when the selection is on the page you are interested in (not in the footnote area)
Code:
Debug.Print Selection.Range.Bookmarks("\Page").Range.Footnotes.Separator.Information(wdVerticalPositionRelativeToPage)
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Many thanks, Guessed! It does work also for me, but I was expecting to find different values depending on the number of footnotes in the page. Instead I get the same value for every page of the document. My aim was to establish the VerticalPosition of the first line of the footnote in various contexts (normal first line, first line of a footnote continuation, first line with hyphenation, etc.). I thought I could do that in a simple way, because my present solution is rather complicated.
|
#4
|
||||
|
||||
I got a different vertical position when the footnotes pushed the separator higher so I thought it would work. It does depend on which page your footnote separator appears on.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#5
|
|||
|
|||
That's what I expected: a different vertical position when the footnotes push the separator higher. What do you mean when you say that it depends on which page the footnote separator appears on. I have tried the code on two different *.docx and I got the same value on every page, though different in the two *.docx.
|
#6
|
||||
|
||||
A footnote separator's position depends on the page you are interrogating. Some pages won't have any footnotes. Pages with footnotes will show a different position for the separator depending on how much content sits in the footnote area of that particular page.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#7
|
|||
|
|||
I'm well aware of the fact that pages with footnotes will show a different position for the separator depending on how much content sits in the footnote area of that particular page. But that's why I cannot understand why the simple code you posted returns the same value for each page with different amounts of content in the footnotes.
|
#8
|
||||
|
||||
OK, it appears that we are just getting the position on the first page.
Can you explain what you need this info for? Perhaps there is a better way to achieve whatever point you have for needing this info. For instance you can audit the page and position of each footnote and surmise that the separator appears a static distance above each top footnote on the page. Code:
Sub aTest() Dim aFN As Footnote For Each aFN In ActiveDocument.Footnotes Debug.Print aFN.Index, aFN.Range.Information(wdActiveEndPageNumber), aFN.Range.Information(wdVerticalPositionRelativeToPage) Next aFN End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#9
|
|||
|
|||
Your new code is very interesting, but I want to test (and possibly use) it on a single page. Could you please modify it? I was only indirectly interested in the Separator vertical position. My aim is a simple macro to establish the VerticalPosition of the first line of the the first footnote on the page. My ultimate aim is to esablish the size of the gap between the last line of text and the first line of the first footnote. The latter varies: it may be a normal first line, the first line of a continuation, a first line with hyphenation, etc.
|
Tags |
footnoteseparator, vertical postion |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
De-limiting the Ruler in the vertical position disabled. | PhilCoolmarket | Word | 3 | 08-03-2018 06:28 AM |
Image absolute position relative to page | thuizt | Word VBA | 4 | 08-01-2017 07:25 AM |
Vertical Scroll Position | Bossmare | Word | 1 | 03-08-2017 07:55 PM |
Vertical Position From Top Off Page Jumping Lines | gc28 | Word | 1 | 04-05-2016 10:59 AM |
Fix data output position relative to page | Al See | Mail Merge | 1 | 01-16-2014 04:13 PM |