![]() |
#2
|
||||
|
||||
![]()
Bearing in mind that there are no 'pages' in a Word document, if your selected range is in a table. then the following is an example of code to move the selection before the table.
Code:
Dim orng As Range Dim oTable As Table Set orng = Selection.Range If orng.Information(wdWithInTable) = True Then Set oTable = orng.Tables(1) orng.Start = oTable.Range.Start orng.Collapse 1 orng.Select Selection.SplitTable Set orng = Selection.Range orng.Text = "The selection is before the table" Else orng.Text = "The selection is not in a table" End If
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
leonelcd | Word VBA | 1 | 11-05-2023 03:28 PM |
Printing Specific Page Issue | FCUCCMV | Word | 2 | 03-07-2022 07:15 AM |
![]() |
pizzaman1 | Word VBA | 6 | 11-14-2014 11:25 PM |
![]() |
mescaL | Word VBA | 3 | 11-03-2014 10:51 PM |
![]() |
ramsgarla | Word VBA | 9 | 12-05-2012 03:23 AM |