OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

saving text formats into DB

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
mitschel
Newbie
Newbie


Joined: 15 Jan 2004
Posts: 4

PostPosted: Thu Jan 15, 2004 1:15 am    Post subject: saving text formats into DB Reply with quote

Hi!

What i want to have :

i mark some text in the document with the mouse. than i want to execute a macro which saves me the text in a DB. so far there is no problem. i get a Cursor Object it from o.Doc.CurrentController.ViewCursor(). This Cursor object includes all information like string, font family, fontstyle,etc! but how can i save all this information in a db? is it possible to get the structure of the object as bank text, which i can save in a db and get it back later? my problem is to get all format information the marked text includes, so i can paste exactly the same from db.

thanks for help!

michael
Back to top
View user's profile Send private message
mitschel
Newbie
Newbie


Joined: 15 Jan 2004
Posts: 4

PostPosted: Mon Jan 19, 2004 2:24 am    Post subject: Reply with quote

no ideas? it´s very important for me...
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Mon Jan 19, 2004 5:10 am    Post subject: Reply with quote

I only copy and past Bernard Marcelly french documentation, add a print :
To print a selection with only one selection :
Code:

Sub Marcelly
  Dim MonDocument As Object
  Dim CurseurVisible As Object
  Dim TexteDeLaSelection As String

  MonDocument = ThisComponent
  CurseurVisible = MonDocument.currentcontroller.ViewCursor
  TexteDeLaSelection = CurseurVisible.String
  print TexteDeLaSelection
  'CurseurVisible.String = " nouveau texte "
End Sub

If your selection contains many text :
Code:

Sub Marcelly2
  Dim MonDocument As Object
  Dim LesSelections As Object
  Dim selx As Integer, UneZone As Object

  MonDocument = ThisComponent
  LesSelections = MonDocument.CurrentSelection
  for selx = 0 to LesSelections.Count -1
    UneZone = LesSelections(selx)
    rem mettre en gras chaque zone sélectionnée
    print UneZone.string
   ' UneZone.CharWeight = com.sun.star.awt.FontWeight.BOLD
  next
End Sub


This is the only beginning part for your problem but I have never used DB with OOo.
There is no problem to put this text in a 00oCalc sheet.
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group