Hello,
I'm back with one more OOo Basic-related question. Is there a way to obtain the user name and initials (those in Tools -> Options -> OpenOffice.org -> User Data) via a macro?
Thank you!
Kind regards,
Dmitri
[Solved] Obtaining user name and initials
[Solved] Obtaining user name and initials
Last edited by Lazy-legs on Wed Jul 02, 2008 10:05 am, edited 1 time in total.
Read the Writer for Writers and Advanced Users book
Re: Obtaining user name and initials
Hi,
You can get them from "/org.openoffice.UserProfile/Data" node of the configuration.
This may help you to get the name of them in the configuration.
http://wiki.services.openoffice.org/wiki/OoConfig
You can get them from "/org.openoffice.UserProfile/Data" node of the configuration.
Code: Select all
Sub GetUserName()
Dim oCP As Object
Dim oCUA As Object
Dim aProps(0) As New com.sun.star.beans.PropertyValue
oCP = GetProcessServiceManager().createInstance( _
"com.sun.star.configuration.ConfigurationProvider" )
aProps(0).Name = "nodepath"
aProps(0).Value = "/org.openoffice.UserProfile/Data"
oCUA = oCP.createInstanceWithArguments( _
"com.sun.star.configuration.ConfigurationUpdateAccess", aProps )
sNames = oCUA.getPropertyValues( Array( "givenname", "sn", "initials" ) )
msgbox "Given Name: " & sNames(0) & chr(10) & _
"Family Name: " & sNames(1) & chr(10) & _
"Initials: " & sNames(2) & chr(10)
'msgbox oCUA.getByName("givenname")
'msgbox oCUA.getByName("sn")
'msgbox oCUA.getByName("initials")
End Sub
http://wiki.services.openoffice.org/wiki/OoConfig
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Apache OpenOffice 4-dev on Xubuntu 14.04
Re: Obtaining user name and initials
Excellent! Than you.
Kind regards,
Dmitri
Kind regards,
Dmitri
Read the Writer for Writers and Advanced Users book