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

extend the UserProfile and sender-fields

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


Joined: 10 May 2005
Posts: 1

PostPosted: Tue May 10, 2005 3:08 am    Post subject: extend the UserProfile and sender-fields Reply with quote

Hi,

I would like to extend the GUI of Tools->Options->User Data which contains information about the current user. My aim is to support individual fields which are not defined in the mask, yet, e.g. a field called "room Number" which we need in our letters. I also would like to use these new fields by including field-Elements to my documents using Insert->Field->Other-->Document/Sender

Is there a way to achive this by changing some configuration files only? Or do I have to change the source-code of OOo?

I already tried to change the the schema file org/openoffice/UserProfile.xcs and the corresponding org/openoffice/UserProfile.xcu, but the changes didn't affekt the diplay in the Tools->Options->UserData GUI.

any ideas or hints?

thank you very much

best regards,
Christoph Lutz
Back to top
View user's profile Send private message
probe1
Moderator
Moderator


Joined: 18 Aug 2004
Posts: 2465
Location: Chonburi Thailand Asia

PostPosted: Tue May 10, 2005 4:08 am    Post subject: Reply with quote

I'm afraid you have to change the source code to get what you want (additional fields in Tools->UserData).

OTOH: I could think of other solutions:

What about inserting those fields (in your documents) from a data source?

Or you could create a "OOo_additional_data.ini" file (in each users OOo-home directory): could be plain text:
Code:
RoomNo=153
where you can read values into documents bookmarks. You can design a data entry form, if users should be able to change it comfortable.

HTH
_________________
Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs
Back to top
View user's profile Send private message Visit poster's website
fell84
Newbie
Newbie


Joined: 10 Dec 2005
Posts: 1

PostPosted: Sat Dec 10, 2005 11:32 am    Post subject: Reply with quote

Hello Winfried,

how can build this solution with the .ini-file. How can I create this special bookmarks.

Than you!
Lars
Back to top
View user's profile Send private message
probe1
Moderator
Moderator


Joined: 18 Aug 2004
Posts: 2465
Location: Chonburi Thailand Asia

PostPosted: Sat Dec 10, 2005 7:09 pm    Post subject: Reply with quote

There is no specific "ini"-File solution, you have to build it to your own needs.

If you like to use plain Basic and a simple file containing such a "room" number, then you can use


Code:

sDateiName = ConvertToURL("/home/username/room_number.txt")

Dim iDateiNr as Integer
iDateiNr = FreeFile

' Textdatei lesend öffnen
' Option "LockReadWirte" sperrt die Datei
' nicht vorhanden: Geräte E/A-Fehler
Open sDateiName for Input Lock Read Write As #iDateiNr

' den einen vorhandenen Satz lesen
Line Input #iDateiNr, sNr

' schliessen
Close #iDateiNr

Msgbox "gelesen " & sNr



To insert (this) text at a bookmark (named: "Room_No") in the actual writer document (created from a template):

Code:

oDok = ThisComponent

' Textmarke
oBM = oDok.getBookmarks().getByName("Room_No")

' Inhalt setzen
oBM.getAnchor().String = sNr


To set the string automatically: combine the code to a routine and assign the routine to the "document creation" event.

Of course you can also use other techniques like a centralised database (sql query against a registered data source) to get values like "the next invoice number"

or use fields instead of bookmarks to retrieve data or fill / generate documents.

Does this help?
_________________
Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs
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