Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return section number

Status
Not open for further replies.

ycim

Programmer
Feb 9, 2005
95
CA
I have been working with Access VBA to manipulate Word to do a document, then read some of the information from Word back into my Access Database.

I cannot figure out how to return the current section number.

For example, VBA will open a Word document, look for a word that they user has previously specified, and then I want it to tell me what section of the word document it is located in.

I know how to access the section using

Code:
word.selection.sections(n)
where n is my index number of the section. Or to access the total amount of sections in the document...
Code:
word.activedocument.sections.count

However, the problem is that I want it to tell me what section the active selection resides (where the cursor is located!)

Any help?
Thank you
 
After much reading, I found a post here that helped me. For those that are looking for the same solution, the code reference is

Code:
word.Selection.Information(wdActiveEndSectionNumber)

Thanks to all anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top