Alle 23:28, luned� 24 gennaio 2005, Klaus Foerst ha scritto:
> Could anyone tell me how to access page styles in an OpenOffice text
> document from a Visual Basic 6 application? I only succeed in opening
> the document, but I do not get access to the styles collection (I want
> to write text into the page headers):

[...]
> Set Supplier = objServiceManager.createInstance_
>     ("com.sun.star.style.XStyleFamiliesSupplier")

Sounds very strange...
Where have you found this ?


> 'now the code breaks:
> Set Styles = Supplier.getStyleFamilies

I think that your Supplier is a Null object, therefore the code breaks here
I'm on Linux now and I cannot test anything, but the following code should 
work:

Set objServiceManager = CreateObject("com.sun.star.ServiceManager") 
Set objDesktop = objServiceManager.createInstance_ 
� � ("com.sun.star.frame.Desktop") 
Set objDocument = objDesktop.loadComponentFromURL_ 
� � ("file:///C:/aaa/test.sxw", "_blank", 0, NoArgs)

Set oFamilies = objDocument.getStyleFamilies
Set oCharStyles = oFamilies.getByname("CharacterStyles")
Set oCharStyleStandard = oCharStyles.getByName("Standard")


HTH
PaoloM









>
> Thanks in advance. Klaus Foerst from Flensburg, Germany
>
> ______________________________________________________________
> Verschicken Sie romantische, coole und witzige Bilder per SMS!
> Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
>
>
> ---------------------------------------------------------------------
> 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