<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - Basic script error after update from LO 6.1.X to LO 6.2.X"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=124251">124251</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Basic script error after update from LO 6.1.X to LO 6.2.X
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>6.2.2.2 release
</td>
</tr>
<tr>
<th>Hardware</th>
<td>x86-64 (AMD64)
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows (All)
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>Calc
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>theimer@seznam.cz
</td>
</tr></table>
<p>
<div>
<pre>Description:
I get err message "Type: com.sun.star.lang.IllegalArgumentException
Message: Invalid attachment file URL." on line"
eMailClient.sendSimpleMailMessage( eMessage, nFlag)" I cant attache screenshot
the script works correctly in LO 6.1.X
REM ***** BASIC *****
Sub Main
End Sub
Sub SendMail 'this is solution for button (variables in czech language)
doc = thisComponent
list = doc.getCurrentController.getActiveSheet
adresa = list.GetCellRangeByName("A1").string
predmet = list.GetCellRangeByName("A2").string
telo = list.GetCellRangeByName("A3").string
priloha = list.GetCellRangeByName("A4").string
Mailer (adresa, predmet, telo, priloha)
end sub
Sub HyperSendMail (sURL$) 'this is solution for function HYPERLINK in the sheet
(variables in czech language)
adresa = getArgumentFromURL(sURL,"MailAddress")
predmet = getArgumentFromURL(sURL, "Subject")
telo = getArgumentFromURL(sURL, "Body")
priloha = getArgumentFromURL(sURL, "Attach")
Mailer (adresa, predmet, telo, priloha)
End Sub
Sub Mailer (eMailAddress as String, eSubject as String, eBody as String,
Attachment as String)
Dim eMailer as Object
Dim eMailClient as Object
Dim eMessage as Object
Dim nFlag as integer
nFlag = 0
eMailer = createUnoService( "com.sun.star.system.SimpleSystemMail" )
eMailClient = eMailer.querySimpleMailClient()
eMessage = eMailClient.createSimpleMailMessage()
eMessage.setRecipient(eMailAddress)
eMessage.setSubject(eSubject)
if Attachment <> "" Then
eAttachmentURL = convertToUrl(Attachment)
eMessage.setAttachement (Array(eAttachmentURL))
end if
eBody = Replace(eBody,"*",chr(10))
eMessage.body = eBody
eMailClient.sendSimpleMailMessage( eMessage, nFlag)
End Sub
REM returns "" if no value was found for name.
Function getArgumentFromURL(sURL$,sName$) as String
on error goto exitErr:
Dim iStart%, i%, l%, sArgs$, a()
iStart = instr(sURL, "?")
l = len(sName)
if (iStart = 0) or (l = 0) then exit function
' sArgs behind "?":
sArgs = mid(sURL, iStart +1)
a() = split(sArgs, "&")
for i = 0 to uBound(a())
' not case sensitive:
if instr(1, a(i), sName &"=", 1) = 1 then
getArgumentFromURL = mid(a(i), l +2)
exit for
endif
next
exitErr:
' return ""
End Function
Steps to Reproduce:
1.run script
Actual Results:
the script stops and write error message
Expected Results:
the script finish as in LO 6.1.X
Reproducible: Always
User Profile Reset: Yes
Additional Info:
[Information automatically included from LibreOffice]
Locale: cs
Module: SpreadsheetDocument
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: no</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>