![]() |
|
#1
|
||||
|
||||
![]()
Word and Excel's VBA is similar but both rely on fixed units for accuracy. Document:Section:Paragraph/Table are the equivalent of Workbook:Worksheet:Cell
Unfortunately, 'page' is not a fixed unit when you are interested in a specific region of content in Word. You can interrogate the content to find out what page something happens to be sitting on but you will get different results if something unrelated causes a change (eg font size changes). Sections are something that we can code for easily. Code:
Dim aTbl As Table For Each aTbl In ActiveDocument.Sections(2).Range.Tables 'code for table goes here Next aTbl Code:
Dim aTbl As Table, aSect As Section Set aSect = Selection.Range.Sections.First For Each aTbl In aSect.Range.Tables 'code for table goes here aTbl.Select Next aTbl
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
vender | Mail Merge | 2 | 05-27-2020 05:18 AM |
Custom page size - Page color not covering entire page when converting to PDF | icor1031 | Word | 9 | 12-09-2019 08:21 PM |
![]() |
MetroBOS | Word | 7 | 01-30-2016 11:31 PM |
2 page document printing problem, text from page 1 in layout of page 2 when printed | laurawether45 | Word | 1 | 08-02-2012 07:03 AM |
![]() |
munna94 | Word | 2 | 12-30-2010 08:12 AM |