I know that if I open a document with writer and navigate
Tools -> Options -> LibreOffice Writer -> Mail Merge E-Mail
I can see the various settings to enable me to send emails. Such as E-Mail Address, Server Name, Port and SSL settings.
How can I find these values using a macro?
I'm using LibreOffice.
Alex
Obtaining Mail Merge E-mail values
-
- Posts: 23
- Joined: Fri Feb 22, 2013 2:15 pm
Obtaining Mail Merge E-mail values
Slackware user
Re: Obtaining Mail Merge E-mail values
You find them in file registrymodifications.xcu of your user profile folder and in plain text unfortunately.
viewtopic.php?f=20&t=29525&p=134621#p134621
viewtopic.php?f=20&t=29525&p=134621#p134621
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Posts: 23
- Joined: Fri Feb 22, 2013 2:15 pm
Re: Obtaining Mail Merge E-mail values
Thanks for the reply. Based on what you advised I developed this bit of code which worked successfully.
I am aware that for LibreOffice the MailMerge password is held in clear text in ~/.config/libreoffice/4/user/registrymodifications.xcu
From what you say this may also be true for OpenOffice.
In my case I'm not storing the password in registrymodifications.xcu but asking the user to supply the password each time they click a button, on a form, to kick off the MailMerge process. I needed the MailAddress so that the user is made aware of what the outgoing email address is so that they can supply the appropriate password.
Thanks so much for your help
Code: Select all
Sub getMailMergeAddress() As String
Const sNodePath$ = "/org.openoffice.Office.Writer/MailMergeWizard"
oNode = getOOoSetupNode(sNodePath$)
getMailMergeAddress = oNode.getByName("MailAddress")
' print MailAddressval
End Sub
Function getOOoSetupNode(sNodePath$)
Dim aConfigProvider, oNode, args(0) As new com.sun.star.beans.PropertyValue
aConfigProvider = createUnoService("com.sun.star.configuration.ConfigurationProvider")
args(0).Name = "nodepath"
args(0).Value = sNodePath
getOOoSetupNode = aConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", args())
End Function
From what you say this may also be true for OpenOffice.
In my case I'm not storing the password in registrymodifications.xcu but asking the user to supply the password each time they click a button, on a form, to kick off the MailMerge process. I needed the MailAddress so that the user is made aware of what the outgoing email address is so that they can supply the appropriate password.
Thanks so much for your help
Slackware user