J'utilise LibreOffice 6.1.
Depuis la mise à jour datant du 17/07/2019, j'ai un problème quand je veux envoyer mes mails avec ma macro calc, qui fonctionnait bien pourtant depuis 12 mois.
Je l'a met ici mais je préviens, c'est de la débrouillardise.
Quand je veux exécuter ma macro je reçois le message MAPI_E_ATTACHEMENT_NOT-FOUND
Ce qui se passe c'est que le fichier est présent avant l’exécution mais qu'il disparait après.
Mon chemin d'accès a toujours fonctionné. J'ai essayé de mettre le dossier A possédant le fichier DEMANDE_RDV2.pdf directement sur le bureau, j'ai l'impression que la macro a gardé le fichier en mémoire MAIS il a disparu du dossier A.
Mais je remarqué que lorsque j’exécute pour la 1er fois, le mail se crée correctement (texte en html) mais que la pièce jointe est en moz_mapi-1.
Je suis inquiet parce que j'ai ai vraiment besoin et notre service info me dit que la mise à jour concernait des failles de sécurité. Ils ne peuvent rien car c'est géré par un prestataire externe.
Pour préserver la confidentialité j'ai changé plusieurs choses dans le fichier.
Merci
Code : Tout sélectionner
Sub mail_14
Dim Messagerie As Object, Client As Object, Courrier As Object
dim doc as object, olig As integer, oxo as integer, per7, per8
dim feuils as object
dim feuil1 as object
dim feuil2 as object, per As object, per1 As object, per2 As object, per3 as object, balise1 As object, balise2 As object, per4 as object, per5 as object, per6 as object
dim adh_num as object, nom as object, mel as object, dater1 As object, siret As object, statut As object, jours As object, dater2 As object
Messagerie = CreateUnoService("com.sun.star.system.SimpleSystemMail")'version Windows Aoo3/Libo3 & LibO4
Client = Messagerie.querySimpleMailClient()
Courrier = Client.createSimpleMailMessage()
doc = thiscomponent
feuils= doc.sheetS
feuil2=feuils.getbyname("tab2")
olig = feuil2.getcellbyposition(12,0).String
adh_num = feuil2.getcellbyposition(1,olig)
mel = feuil2.getcellbyposition(13,olig)
nom = feuil2.getcellbyposition(2,olig)
dater1= feuil2.getcellbyposition(3,olig)
siret= feuil2.getcellbyposition(14,olig)
per= feuil2.getcellbyposition(7,olig)
per1= feuil2.getcellbyposition(8,olig)
per2= feuil2.getcellbyposition(9,olig)
per3= feuil2.getcellbyposition(10,olig)
per4=feuil2.getcellbyposition(11,olig)
per5 = feuil2.getcellbyposition(20,olig)
per6 = feuil2.getcellbyposition(21,olig)
dater2= feuil2.getcellbyposition(27,0)
per7=feuil2.getcellbyposition(6,olig)
per8=feuil2.getcellbyposition(12,olig)
feuil2.getcellbyposition(7,0).string = per.string
feuil2.getcellbyposition(8,0).string = per1.string
Courrier.Recipient = mel.string'Adresse de l'adherent
If per7.string = 05 or per7.string = 15 THEN
Courrier.Subject = "APST BTP RP - Declaration non parvenue - " & adh_num.string & " " & nom.String
courrier.body = "<html>blblblbla</html>"
Courrier.Attachement = Array("J:\Mes documents\A\TELEDECLARATION.pdf", "J:\Mes documents\A\BORDEREAU3.pdf" , "J:\Mes documents\A\CONNEXION_INTERNET.pdf","J:\Mes documents\A\NOTE.pdf")'PcsJt()
else
If per7.string = 05 or per7.string = 15 THEN
Courrier.Subject = "APST BTP RP - Declaration non parvenue- " & adh_num.string & " " & nom.String
courrier.body = "<html>blblblbla</html>"
Courrier.Attachement = Array("J:\Mes documents\A\TELEDECLARATION.pdf", "J:\Mes documents\A\BORDEREAU3.pdf" , "J:\Mes documents\A\CONNEXION_INTERNET.pdf","J:\Mes documents\A\NOTE.pdf")'PcsJt()
else
If per7.string = 03 or per7.string = 13 THEN
Courrier.Subject = "APST BTP RP - Reglement_sans_bordereau - " & adh_num.string & " " & nom.String
courrier.body = "<html>blblblbla</html>"
Courrier.Attachement = Array("J:\Mes documents\A\BORDEREAU3.pdf", "J:\Mes documents\A\CONNEXION_INTERNET.pdf","J:\Mes documents\A\NOTE.pdf")'PcsJt()
End If
end if
end if
'<header> <img src=""W:\logo.jpg"" ></header>
Client.sendSimpleMailMessage(Courrier,1)
End Sub
'==================
sub envoi_mail_relance3
dim oxo as integer, olig As integer, feuil2 As object, oli As integer, mel as object
dim document as Object
document = ThisComponent.CurrentController
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
feuil2=document.activesheet("tab2")
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint" '
args1(0).Value = "tab2.a2"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
call mutli.x_lite
oxo = document.activesheet("tab2").getcellbyposition(15,0).string
olig = 1
oli = 0
feuil2.getcellbyposition(12,0).string= olig
DO
if oxo <= 0 then exit Do
mel = feuil2.getcellbyposition(13,olig)
if mel.string ="UNDELIVERED@apst.fr" or mel.string ="undelivered@@apst.Fr" Or mel.string ="#N/D" Or mel.string = "" or mel.string ="undelivered@apst.fr" or mel.string = 0 Or mel.string ="#VALEUR !" Then
wait 1
call mutli.coloriage
dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "",0, args1())
else
if mel.string <>"UNDELIVERED@apst.fr" or mel.string <>"undelivered@@apst.Fr" Or mel.string <>"#N/D" Or mel.string <> "" or mel.string <>"undelivered@apst.fr" or mel.string <> 0 Or mel.string <>"#VALEUR !" Then
if feuil2.getcellbyposition(9,olig).string <> 40 then
On Error Resume Next
call mutli.coloriage2
'call Module2.mail_18
wait 1
else
if feuil2.getcellbyposition(9,olig).string = 40 then
On Error Resume Next
wait 10
call mutli.coloriage3
call mail_14
end if
End If
dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "",0, args1())
end if
oli= oli + 1
end if
olig= olig +1
feuil2.getcellbyposition(13,0).string= oli
feuil2.getcellbyposition(12,0).string= olig
feuil2.getcellbyposition(10,0).string = oxo
feuil2.getcellbyposition(11,0).string= mel.string
If oli = 10 Then
wait 30000
oli = 0
End if
loop until olig -1= document.activesheet("tab2").getcellbyposition(14,0).string 'document.sheets.getbyname("tab2").getcellbyposition(14,0).string = 0
dispatcher.executeDispatch(document, ".uno:Save", "", 0, args1())
'dispatcher.executeDispatch(document, ".uno:Quit", "", 0, args1())
end Sub
'==================================
Ajout : - Je n'ai pas vu quand le modérateur a changé le titre - le fichier est trop lourd |