Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Finding Out What the Current Section Is

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Larry Lutz - 15 Jan 2006 23:48 GMT
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

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.