Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Alexandru Apostu
  Where is Alexandru Apostu?
 Slobozia
 Romania
 Alexandru Apostu
 Tags
Subject: OpenOffice Writer Automation with VFP9
Thread ID: 204779 Message ID: 204779 # Views: 68 # Ratings: 0
Version: Visual FoxPro 9 Category: Microsoft Office Automation
Date: Sunday, November 23, 2008 4:22:27 PM         
   


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




COMPLETE THREAD

Tip: click here to scan for Windows Registry Errors and Optimize PC performance
OpenOffice Writer Automation with VFP9 Posted by Alexandru Apostu @ 11/23/2008 4:22:27 PM
RE: OpenOffice Writer Automation with VFP9 Posted by Anders Altberg @ 11/23/2008 5:46:51 PM
RE: OpenOffice Writer Automation with VFP9 Posted by Alexandru Apostu @ 11/23/2008 5:52:42 PM
RE: OpenOffice Writer Automation with VFP9 Posted by Alexandru Apostu @ 11/23/2008 6:08:31 PM
RE: OpenOffice Writer Automation with VFP9 Posted by Anders Altberg @ 11/23/2008 6:32:39 PM
RE: OpenOffice Writer Automation with VFP9 Posted by Alexandru Apostu @ 11/23/2008 6:50:36 PM
RE: OpenOffice Writer Automation with VFP9 Posted by Mike Gagnon @ 11/24/2008 11:55:44 AM
RE: OpenOffice Writer Automation with VFP9 Posted by Alexandru Apostu @ 11/25/2008 2:51:28 PM
RE: OpenOffice Writer Automation with VFP9 Posted by A Roy Chowdhury @ 11/26/2008 7:44:20 AM
RE: OpenOffice Writer Automation with VFP9 Posted by Alexandru Apostu @ 11/26/2008 4:36:02 PM
RE: OpenOffice Writer Automation with VFP9 Posted by A Roy Chowdhury @ 11/27/2008 7:22:17 AM
RE: OpenOffice Writer Automation with VFP9 Posted by Alexandru Apostu @ 11/27/2008 9:56:13 AM
RE: OpenOffice Writer Automation with VFP9 Posted by Alexandru Apostu @ 11/27/2008 10:07:53 AM
RE: OpenOffice Writer Automation with VFP9 Posted by A Roy Chowdhury @ 11/28/2008 5:57:29 AM
RE: OpenOffice Writer Automation with VFP9 Posted by Alexandru Apostu @ 11/28/2008 5:17:58 PM
RE: OpenOffice Writer Automation with VFP9 Posted by Anil Sharma @ 11/27/2008 8:29:43 AM
RE: OpenOffice Writer Automation with VFP9 Posted by Alexandru Apostu @ 11/27/2008 10:12:27 AM