For the life of me, I can find a way to determine what section of the
document the current selection is in. It seems like a simple task, but
somehow, I just can't seem to get the syntax right. I'm using a macro to
build a document, and I want it to do one thing if the current selection is
in Section 2 of the document and something else if it isn't, as in:
If Current Section = 2 then
Do one thing
Else
Do something else
End If
I need this macro to work in Word 2000, XP, and 2003. (We can't seem to get
everyone on the same version.) Any help that you can give will be most
appreciated.
Larry
Tony Jollans - 16 Jan 2006 00:50 GMT
Try Selection.Sections(1).Index
--
Enjoy,
Tony
> For the life of me, I can find a way to determine what section of the
> document the current selection is in. It seems like a simple task, but
[quoted text clipped - 13 lines]
>
> Larry
Doug Robbins - Word MVP - 16 Jan 2006 05:24 GMT
Selection.Information(wdActiveEndSectionNumber)

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> For the life of me, I can find a way to determine what section of the
> document the current selection is in. It seems like a simple task, but
[quoted text clipped - 13 lines]
>
> Larry