![]() |
|
#1
|
||||
|
||||
![]()
'Lines' are a vague concept in Word, especially in a document that is dynamically formatted and doubly so when there are columns.
I won't pretend to know what your document looks like and so I can't test your macro to see what it does in practice, but as you have discovered, moving down by lines ignores the presence of a second column of text and continues to the next page. You need to move right to move the next column. I suppose you could test whether the page has changed each time you move down and then move back and move right to the start of the next column (that will also take you to the start of the next page) e.g. as follows but whether it will work in the context of your macro is hard to ascertain Code:
'Move to the next part of the loop ##but wont do this when more than 1 column of text iPage = Selection.Information(wdActiveEndPageNumber) Selection.MoveDown Unit:=wdLine, Count:=1 If Selection.Information(wdActiveEndPageNumber) > iPage Then Selection.MoveUp Unit:=wdLine, Count:=1 Selection.EndKey Unit:=wdLine, Extend:=wdExtend Selection.MoveRight Unit:=wdCharacter 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 |
![]() |
mertdogan | Word Tables | 2 | 08-03-2017 03:46 PM |
![]() |
Mutak94 | Word Tables | 1 | 09-12-2014 02:52 PM |
![]() |
ramsgarla | Word VBA | 9 | 12-05-2012 03:23 AM |
Columns. How to move the left column so it's to the right of the 'right' column ? | Vit | Word | 9 | 11-21-2012 12:57 PM |
![]() |
Rigwald | Word Tables | 9 | 08-07-2012 08:14 PM |