Hi,

I use OpenSuSE 10.2, kernel 2.6.18.2. I have OpenOffice3.org and
OpenOffice.org SDK version is 3.0. My OOImpress presentation has 7 slides in
all. I want to save each of the 7 slides as different OOImpress
presentations in different files. For, example, Slide 1 in the original
presentation should be copied and saved as another presentation file as
slide1.odp, Slide2 in original should be saved as slide2.odp and so on. The
final result is, I have 7 different slides with different filenames. I want
to do this in C++.

What I have dont so far:
1. I used the DocumentLoader.cxx program, available with the OpenOffice.org
SDK and added few lines from the code available here
http://codesnippets.services.openoffice.org/Impress/Impress.DealWithImpress.snip.
DocumentLoader.cxx program loads test.odt but I have changed this and
instead it loads my presentation file test.odp

2. What I have taken from the Code Snippet example is this piece:

//Loop through all pages and give Pagenumber+Pagename to each of them
        for (int icounter = 0; icounter < pagecount->getCount(); icounter++)
        {
                Any mPage = pagecount->getByIndex(icounter);
                Reference <XDrawPage> drawpage(mPage, UNO_QUERY);
                Reference <::com::sun::star::container::XNamed>
names(drawpage, UNO_QUERY);
                OUString pagename = names->getName();
                OString sName = OUStringToOString( pagename ,
RTL_TEXTENCODING_ASCII_US );
                printf("\n Page Number %d has the name %s", icounter,
sName.getStr());
        }

3.  The above code, loops through all the pages present in the file and
prints the Slide Name and Number.

4. Similarly, I want to loop through all the pages and one by one keep
saving them in different presentation files as said above.

Any idea, how this can be done?
Please feel free to ask in you are in doubt. If anybody wants to see the
code, I'll be happy to share it.

Thank you.

Regards,

Shoaib

Reply via email to