| View previous topic :: View next topic |
| Author |
Message |
clutz Newbie

Joined: 10 May 2005 Posts: 1
|
Posted: Tue May 10, 2005 3:08 am Post subject: extend the UserProfile and sender-fields |
|
|
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 |
|
 |
probe1 Moderator


Joined: 18 Aug 2004 Posts: 2465 Location: Chonburi Thailand Asia
|
Posted: Tue May 10, 2005 4:08 am Post subject: |
|
|
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: 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 |
|
 |
fell84 Newbie

Joined: 10 Dec 2005 Posts: 1
|
Posted: Sat Dec 10, 2005 11:32 am Post subject: |
|
|
Hello Winfried,
how can build this solution with the .ini-file. How can I create this special bookmarks.
Than you!
Lars |
|
| Back to top |
|
 |
probe1 Moderator


Joined: 18 Aug 2004 Posts: 2465 Location: Chonburi Thailand Asia
|
Posted: Sat Dec 10, 2005 7:09 pm Post subject: |
|
|
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 |
|
 |
|