Sign in to follow this  
Followers 0
nobbe

Using Openoffice as PDF & HTML Converter

3 posts in this topic

#1 ·  Posted (edited)

Sample code showing how to open files with openoffice Writer and Calc / read text / save as HTML or PDF

- added gettext

- added a batch converter for RTF->PDF

openoffice_test.au3

Edited by nobbe
1 person likes this

Share this post


Link to post
Share on other sites



this is how to insert a picture

(but i cant get more than one picture to work..?)

CODE
;

; insert a Picture at end of file

;

Func _OO_INSERT_PIC($file)

$file = _Convert2URL($file);

$objText = $OO_Doc.getText();

$objCursor = $objText.createTextCursor()

$graficobject = $OO_Doc.createInstance("com.sun.star.text.TextGraphicObject");

$graficobject.GraphicURL = $file

; insert picture in file

$objText.insertTextContent($objCursor, $graficobject, False);

EndFunc ;==>_OO_INSERT_PIC

Share this post


Link to post
Share on other sites

Hi nobbe,

I have just tried your example and it does not seem to work with OpenOffice 3.0.

I get the following error:

file:///test.doc

C:\openoffice_test.au3 (160) : ==> The requested action with this object has failed.:

$OO_Doc = $OO_Desktop.loadComponentFromURL($infile, "_blank", 0, $inputargs)

$OO_Doc = $OO_Desktop.loadComponentFromURL($infile, "_blank", 0, $inputargs)^ ERROR

Do you have any idea why this may be failing, other than the fact that I am using OpenOffice 3.0?

Cheers,

Angel

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0