von komma4 » Fr, 13.06.2008 18:17
Andreas,
das folgende Beispiel holt sich die Daten aus der OOo Anmeldeinformationen.
Du bekommst nicht den Windows-Anmeldenamen, aber den Vor-/Nachnamen, wie er in
Extras>Optionen...>OpenOffice.org>Benutzerdaten eingetragen ist.
Code: Alles auswählen
Sub Main
' http://www.oooforum.org/forum/viewtopic.phtml?t=1446
' paro Jun 17, 2003 11:24 am
Dim oConfigProvider as Object
Dim oRegistryKeyContent as Object
Dim aNodePath(0) as new com.sun.star.beans.PropertyValue
oConfigProvider = createUnoService("com.sun.star.configuration.ConfigurationProvider")
aNodePath(0).Name = "nodepath"
aNodePath(0).Value = "org.openoffice.UserProfile/Data"
oRegistryKeyContent = _
oConfigProvider.createInstanceWithArguments( _
"com.sun.star.configuration.ConfigurationAccess", aNodePath())
Msgbox oRegistryKeyContent.o
Msgbox oRegistryKeyContent.givenname
Msgbox oRegistryKeyContent.sn
Msgbox oRegistryKeyContent.initials
Msgbox oRegistryKeyContent.title
Msgbox oRegistryKeyContent.position
Msgbox oRegistryKeyContent.telephonenumber
Msgbox oRegistryKeyContent.facsimiletelephonenumber
Msgbox oRegistryKeyContent.homephone
Msgbox oRegistryKeyContent.mail
Msgbox oRegistryKeyContent.st
Msgbox oRegistryKeyContent.street
Msgbox oRegistryKeyContent.postalcode
Msgbox oRegistryKeyContent.UserGroup
Msgbox oRegistryKeyContent.c
Msgbox oRegistryKeyContent.l
End Sub
Hilft das?
Andreas,
das folgende Beispiel holt sich die Daten aus der OOo Anmeldeinformationen.
Du bekommst nicht den Windows-Anmeldenamen, aber den Vor-/Nachnamen, wie er in [color=#008000]Extras>Optionen...>OpenOffice.org>Benutzerdaten[/color] eingetragen ist.
[code]Sub Main
' http://www.oooforum.org/forum/viewtopic.phtml?t=1446
' paro Jun 17, 2003 11:24 am
Dim oConfigProvider as Object
Dim oRegistryKeyContent as Object
Dim aNodePath(0) as new com.sun.star.beans.PropertyValue
oConfigProvider = createUnoService("com.sun.star.configuration.ConfigurationProvider")
aNodePath(0).Name = "nodepath"
aNodePath(0).Value = "org.openoffice.UserProfile/Data"
oRegistryKeyContent = _
oConfigProvider.createInstanceWithArguments( _
"com.sun.star.configuration.ConfigurationAccess", aNodePath())
Msgbox oRegistryKeyContent.o
Msgbox oRegistryKeyContent.givenname
Msgbox oRegistryKeyContent.sn
Msgbox oRegistryKeyContent.initials
Msgbox oRegistryKeyContent.title
Msgbox oRegistryKeyContent.position
Msgbox oRegistryKeyContent.telephonenumber
Msgbox oRegistryKeyContent.facsimiletelephonenumber
Msgbox oRegistryKeyContent.homephone
Msgbox oRegistryKeyContent.mail
Msgbox oRegistryKeyContent.st
Msgbox oRegistryKeyContent.street
Msgbox oRegistryKeyContent.postalcode
Msgbox oRegistryKeyContent.UserGroup
Msgbox oRegistryKeyContent.c
Msgbox oRegistryKeyContent.l
End Sub
[/code]
Hilft das?