Hi Laurent,
Laurent Duperval wrote:

I recorded a macro to change font colors for two of my styles. The idea is to allow me to create a handbook, and by running the macro, make the answers appear or disappear.
[...]
Can I automate this completely? This is the sample code that was recorded:


You can call the sub below, with the necessary arguments.

Sub ChangeStyleProp (oDoc, sMyStyleFamilie$, sMyStyleName$,
                        sPropName$, nPropValue  as long) as Integer

        Dim xFamilies as object
        Dim xFamily as object
        Dim xStyle as Object

        xFamilies = oDoc.getStyleFamilies()     
        xFamily = xFamilies.getByName (sMyStyleFamilie)
        xStyle = xFamily.getByName (sMyStyleNaam)
        xStyle.setPropertyValue (sPropName, nPropValue )                

End Sub


--

Cor Nouws
Arnhem - Netherlands
nl.OpenOffice.org - marketing contact

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

Reply via email to