Imprimer une piece jointe sur le web
Bonjour à tous, j'ai un très gros problème et j'espère que vous pourrez m'aidez.Le code ci après me permet d'imprimer une pièce jointe directement depuis une vue (après avoir sélectionner un doc, on clic sur le bouton qui lance cet agent) sur le web.Le problème est que cet agent fonctionne très bien sauf la première fois que cet agent est exécuté après l'ouverture de la base sur le web (ensuite aucun problème).Sauriez vous pourquoi ce problème ce produit ? Dim tDocuments() As notesDocumentDim nNbDoc As IntegerDim sNomVue As StringDim d As VariantDim docid As StringDim session As New notessessionDim db As NotesDatabaseDim tempdoc As NotesDocument'on va recupérer l'id du document et le nom de la vueSet tempdoc = session.DocumentContextsNomVue= getURLParameter(tempdoc.query_string_decoded(0),"view") docid="view"unid=Instr(tempdoc.query_string_decoded(0),"listedoc=")unid=Mid(tempdoc.query_string_decoded(0),unid+9,32)'on récupère le nom du fichier attachéSet db=session.CurrentDatabaseSet doc=db.GetDocumentbyunid(unid) Call doc.ReplaceItemValue("StatutImpression", "Envoyé")Call doc.save(True,True)Set rtitem = doc.GetFirstItem( "Body" )Forall att In rtitem.EmbeddedObjectsIf att.Type = EMBED_ATTACHMENT Thennom_fichier=att.SourceEnd IfEnd ForallDim odoc As notesdocumentDim sScriptJavascript As StringDim sIdDoc As StringDim aaa As Stringaaa="http://serveur/intranet/drh/abcv/srvabcvcand.nsf/ViewAFaireCourriersAEnvoyer/"+unid+"/$file/"+nom_fichiersScriptJavascript = "<script language =""javascript"" > "+_" window.top.FrameImpression.location.href = '"+aaa+"'; "+_" window.top.FrameImpression.focus() ; "+_" window.top.FrameImpression.print(); " +_" self.close(); " +_" </script> "Print sScriptJavascript