How to detect content outside of page margins?

R

rVo

Is there a way to detect tat certain elements on a page are (partly) outside
of the page margins?

Thanks for your time/advice.

Kind regards,

rVo
 
C

Cindy M -WordMVP-

Hi RVo,
Is there a way to detect tat certain elements on a page are (partly) outside
of the page margins?
What kinds of elements do you have in mind?

Basically, you'd have to check the position and compare it to the margin
settings. How to check the position depends on what's involved...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
R

rVo

Hi Cindy,

I would like to know if a table extends outside the page margins and if so
set the section in which the table is positioned in landscape mode (if it
wasn't already).
Upto now (been playing around with it) I came up with... (have to put
everything into comment because of paranoid firewall, sorry for that)

'Sub test()
' Dim tbl As Table
' Dim tblColumn As Column
' Dim tblWidth As Integer
'
' tblWidth = 0
'
' For Each tbl In ActiveDocument.Content
' For Each tblColumn In tbl.Columns
' tblWidth = tblWidth + tblColumn.Width
' Next clm
' If tblWidth > ActiveDocument.PageSetup.PageWidth Then
' 'stuck here
' End If
' tblWidth = 0
' Next tbl
'
'End Sub

Kind regards,

rVo
 
C

Cindy M -WordMVP-

Hi RVo,
I would like to know if a table extends outside the page margins and if so
set the section in which the table is positioned in landscape mode (if it
wasn't already).
Upto now (been playing around with it) I came up with... (have to put
everything into comment because of paranoid firewall, sorry for that)
This is probably the best way to approach the problem. If you were concerned
about the left margin, then there would be an alternative or two. But since
you can't be sure that any text in the last column would actually be outside
the margin...
'Sub test()
' Dim tbl As Table
' Dim tblColumn As Column
' Dim tblWidth As Integer
'
' tblWidth = 0
'
' For Each tbl In ActiveDocument.Content
' For Each tblColumn In tbl.Columns
' tblWidth = tblWidth + tblColumn.Width
' Next clm
' If tblWidth > ActiveDocument.PageSetup.PageWidth Then
' 'stuck here
' End If
' tblWidth = 0
' Next tbl
'
'End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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