Word VBA >> SectionRef field code similar to PageRef field code functionality

by Doug Robbins » Sat, 31 Jul 2004 07:17:29 GMT

MsgBox
ActiveDocument.Bookmarks("test").Range.Information(wdActiveEndSectionNumber)


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"Tim" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
>
> I am looking for a method to return the section number for a bookmark
> using a field code
> --
> Tim Shaffer




Similar Threads

1. SectionRef field code similar to PageRef field code functional - Word VBA

2. Field Code PageRef is not updating when word doc opened

MS Word 2007 use of quickparts Field Code PageRef problem.  The value for the 
reference is not automatically updating when document is opened, or when 
document is changed.  It appears it only updates if I highlight area and 
click update.  How can I make it so the PageRef is dynamically updated as 
document is changed, saved or when opened?

3. edit text displayed while using PageRef field code

4. Update Field Codes Toggeles Field Code Vview

Just recently my work computer started behaving 
differently when I update FIELDS.  When ever I update the 
fields in the document, the Field Code toggles to ON.  how 
can I stop them from toggling when I update??  This seems 
to have started after opening a WORD document creeated on 
the Chinese versions of WIN2k and WORD2k.  My machine:  
WIN2k, WOrd 97 and Word2k (same behavior both WORDs).  ANy 
Ideas??  Thanks. Troy

5. Word 2003 Field code within a field code

6. cross reference for replacing old field codes with new fields code

i need to convert a large number of documents from a legacy system to MSWord. 
The documents present in word with the old systems field codes.  Can I effect 
a cross reference which will effectively find the old code and update it with 
the new code?
 
Thanks

Joy

7. Field Codes - enable then disable field codes on document close

8. Switches/field codes to fix zip code in merge

Office 2003
I've been reading a lot on Graham's site about fixing zip codes, but using 
switches and field codes is all new to me and I can't figure it out. I keep 
getting the error message "Error! Missing test condition" when I toggle back. 
I'm trying to get an Excel list that has 5-digit zips and 9-digit zips to 
print out properly in a label merge. Here's what I have for the last line of 
merge fields: 

{ MERGEFIELD CITY }, {MERGEFIELD STATE } { IF {MERGEFIELD ZIP } > 99999" { 
MERGEFIELD ZIP \# "00000'-'0000" }" "{ MERGEFIELD ZIP \# "00000" }"}

I'm using Ctrl F9 for the brackets, I've entered the above from Graham's 
site, but am not sure about spacing, etc.  

Thanks for any help -- Mrsmac