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
where n is my index number of the section. Or to access the total amount of sections in the document...
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
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)
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