Hko General User

Joined: 30 May 2004 Posts: 25 Location: The Netherlands, Europe
|
Posted: Sun Dec 12, 2004 3:12 pm Post subject: Iterating fields in header of writer doc. |
|
|
Hi,
I'm writing a macro in OO-Basic that iterates through (datetime) fields with:
| Code: | enum = thisComponent.getTextFields().createEnumeration
while enum.hasMoreElements
field = enum.nextElement
if field.supportsService("com.sun.star.text.TextField.DateTime") then
range = field.getAnchor()
' -- Do things with the field
end if
wend
|
This also iterates through fields in the pageheader, which is what I want.
But how to check if the current field in the loop is inside the header or in the text (or in any other part of the doc for that matter)?
Or the other way around: first loop iterates through the fields in the header only, second loop goes through the fields in the text itself. Can this be done?
Thanks in advance,
Heiko |
|