Hi Dear Experts,
I'm using VFP9 and OpenOffice
and i want to:
- open a blank
OpenOffice.org Writer document with Visual Fox Pro
- insert some bold text into the opened document
- insert some italic and bold text
- insert some bold, underlined and aligned to center text
- and in the end, select all text and justify it both left and right
and leave the document opened so i can save it or modify it
how to open a new OOffice doc, i know
how to insert some normal text, i know
but
how can i insert some formated text like italic, aligned to center or right, that i don't know
i have this code:
*############################################################## test.prg
LOCAL loOfcMgr, loDesktop, loDocument, args(1), loCoreReflection, loPropertyValue,loText,loCursor
* Create the Service Manger and Desktop
loOfcMgr = CreateObject("com.sun.star.ServiceManager")
loDesktop = loOfcMgr.createInstance("com.sun.star.frame.Desktop")
** The args array is an array of "PropertyValue - objects - create by invoking OO.o reflection
loCoreReflection = loOfcMgr.createInstance("com.sun.star.reflection.CoreReflection" )
loPropertyValue = CREATEOBJECT("Empty")
loCoreReflection.forName("com.sun.star.beans.PropertyValue"). createobject(@loPropertyValue)
args[1] = loPropertyValue
args[1].name = "CenterPara"
args[1].value = .T.
* Tell VFP to pass arrays to the loDesktop object as zero-based, by reference
*COMARRAY(loDesktop,10)
* Open a new empty writer document
loDocument = loDesktop.loadComponentFromURL("private:factory/swriter","_blank", 0, @args)
** Insert sample Text
loText=loDocument.getText() && Create text object
* Create a cursor object (position pointer)
loCursor= loText.createTextCursor()
**
*loCursor.CharHeight = 16
*loCursor.CharWeight = 100
*loText.insertString(loCursor, "my text", .F.)
*############################################################## end
please tell me how can i insert italic text, aligned text.. etc. please
can you do this? please