![]() |
|
|
Thread Tools | Display Modes |
#4
|
||||
|
||||
![]()
Cendrinne
Think about VBA commands as basically a roadmap, zooming in to lower levels as you go. It is similar to saying Earth.Canada.Quebec.Montreal - each steps gives greater resolution. We can't just say Montreal because there are Montreal streets in cities all over the world. Each vba command is part of a chain that provides context for the next command. Sections(1) tells you something but without the context preceding it we can only guess which Section was intended. ActiveDocument.Sections(2).Paragraph(3) would be saying -> think of the active document, now in that document think of the second section, now in that section think of the third paragraph Selection.Range.Sections(1).Range.Start is saying -> go to the current selection, then convert it into a range object, then look at the entire section where that range starts, then convert that section into a range, then tell me the position where that range starts. So all of that is just to work out a position which I then use to define the start of a range. Code:
ActiveDocument.Range(Selection.Range.Sections(1).Range.Start, ActiveDocument.Range.End) Go to the active document and then in that document think of a range that starts with the a position (as described in above paragraph) and ends at the end of the document.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Tags |
align tables in section, help please |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Something in header with text boxes won't let a section align vertically - sometimes | ryannah05 | Word | 5 | 04-10-2020 09:48 AM |
![]() |
olybobo | Excel Programming | 1 | 05-26-2016 01:09 AM |
Script starts nesting tables without reason | selman555 | Word VBA | 1 | 10-17-2014 01:01 AM |
![]() |
Joey Cheung | Word Tables | 1 | 08-08-2014 11:34 PM |
![]() |
Dr Wu | Word | 1 | 01-03-2014 02:07 PM |