Alright, after some replies with code that was just out of the box, meaning it wasn't well thought about, I decided to spend some more time on this coming up with a hopefully complete-working macro. The result can be seen on:
http://www.oooforum.org/forum/viewtopic.phtml?t=20153

As a remark: It is nice to see how much can be done with just the viewcursors, no need for a textcursor to accomplish such a task.

Tom, if you want to include this into your snippets page you can go ahead.
As said on the linked page, please give me some input if you encounter problems with this macro, I have not done any extensive tests yet.

2005/5/13, malcolm cooke <[EMAIL PROTECTED] >:
Hi,

I wonder if anyone can give me pointers how to do this?

Background - a document is created programmatically from a template and in
the process text  added / removed. As a result now end up with empty pages
because of the way text is now flowing through the document. There is a
need to remove the extra blank pages.

I have looked at content xml to see if anything obvious to identify the
blank page and there isn't (which I suppose is understandable because the
blanks pages are a symptom of the 'presentation' of the content)

I have looked through the api and there is nothing obvious there either.

One possibility comes to mind but I'm not experienced enough with the api's
to know if it is a feasible approach or not :

identify number of pages in doc.
for each page in doc
        use XpageCursor to jump to page
        somehow extract the text range for each page (? create a text cursor for
the page)
        if text range is empty
                store page number
for each stored page number (processed in reverse order)
        remove the page from the document (?how)

Perhaps someone with more knowledge could comment on what I'm trying to do
or point to some other part of the api which might do what I want to do.

Thanks

Malcolm

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.9 - Release Date: 12/05/2005

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Best Regards
Christian Junker

Reply via email to