![]() |
|
|
|
#1
|
||||
|
||||
|
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 |
|
#2
|
|||
|
|||
|
Quote:
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Word Macro VBA | Insert images one by one, page by page
|
leonelcd | Word VBA | 1 | 11-05-2023 03:28 PM |
| Printing Specific Page Issue | FCUCCMV | Word | 2 | 03-07-2022 07:15 AM |
Macro for word to add page break and specific text to end of document
|
pizzaman1 | Word VBA | 6 | 11-14-2014 11:25 PM |
Macro to insert multiple pictures to word to a specific size and text wrap
|
mescaL | Word VBA | 3 | 11-03-2014 10:51 PM |
Selection of all Text for a specific page in word is spanning selection across pages
|
ramsgarla | Word VBA | 9 | 12-05-2012 03:23 AM |