To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=68579
                 Issue #|68579
                 Summary|Table of Content Page Numbers wrong when updated from 
                        |Macro via command line
               Component|Word processor
                 Version|OOo 2.0.3
                Platform|All
                     URL|
              OS/Version|Windows XP
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P2
            Subcomponent|programming
             Assigned to|mru
             Reported by|kingargyle





------- Additional comments from [EMAIL PROTECTED] Sun Aug 13 20:41:37 -0700 
2006 -------
When using OpenOffice Basic to update the table of contents for large documents
generated outside of the OpenOffice, the table of contents are not updated
correctly with the correct page numbers unless you wait a minimum of 30 seconds
to allow open office to repaginate and create the layout cache.   If the
document is opened, and then saved.   The page numbers are generated correctly
as the layout cache seems to have been updated correctly.    If using the
dispatcher and UNO to update the table of contents everything updates correctly,
however, this can only be used if OO is going to be running in the foreground
and not being used to batch conversion of files to PDF.

The following is some sample macro code:
Sub SaveAsPDF( cFile )
   Dim oDoc as Object
   Dim oIndexes as Object
   Dim oIndex as Object

 cURL = ConvertToURL( cFile )
   oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank", 0, (_
            Array(MakePropertyValue( "Hidden", True ),))


   cFile = Left( cFile, Len( cFile ) - 4 ) + ".doc"
   cURL = ConvertToURL( cFile )

  ' Update the Indexes (does not work correctly on 100+ page documents)
   oIndexes = oDoc.getDocumentIndexes()

        for i = 0 to oIndexes.Count -1
         oIndexes(i).update
        next i

' Save the document using a PDF filter.   
   cFile = Left( cFile, Len( cFile ) - 4 ) + ".pdf"
   cURL = ConvertToURL( cFile )

   oDoc.storeToURL( cURL, Array(_
            MakePropertyValue( "FilterName", "writer_pdf_Export" ),)
  
   oDoc.close( True )
end sub

Also attached is a sample document.   If the document is opened normally and the
uno macro is allowed to run it works correctly.  But the UI is not going to be
available when this is run from a batch mode via ANT during a build.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

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


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

Reply via email to