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 / November 2004

Tip: Looking for answers? Try searching our database.

How to reference a given paragraph in the ActiveDocument.Paragraphs collection?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
keith brickey - 18 Nov 2004 21:54 GMT
How can I reference a given paragrah as a member of
ActiveDocuments.Paragraphs? In other words I need to know the Index that
would point to ActiveDocuments.Paragraphs(Index) for a paragraph object
named para.

Thanks,

Keith
Jay Freedman - 18 Nov 2004 23:50 GMT
>How can I reference a given paragrah as a member of
>ActiveDocuments.Paragraphs? In other words I need to know the Index that
[quoted text clipped - 4 lines]
>
>Keith

Hi Keith,

If the selection (cursor) is in that paragraph, then the expression
you want is Selection.Paragraphs(1) -- that is, it's the first
paragraph in the selection, and it doesn't usually matter what its
index is within the ActiveDocument. The same principle is true for any
collection, and it's also true for references using a Range object
instead of the Selection.

For the few times you really need the absolute index within the
ActiveDocument, see
http://word.mvps.org/FAQs/MacrosVBA/GetIndexNoOfPara.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP         FAQ: http://word.mvps.org
 
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.