OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Iterating fields in header of writer doc.

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Hko
General User
General User


Joined: 30 May 2004
Posts: 25
Location: The Netherlands, Europe

PostPosted: Sun Dec 12, 2004 3:12 pm    Post subject: Iterating fields in header of writer doc. Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group