par Sylvain » 11 Mars 2003 à 15:43
Dans ce cas c moins facile.Il faut que tu gere tout toi même en lotusScript à partir d'un bouton "Modifier" par exemple.Les étapes du traitement sont les suivantes :- Détacher la pièce jointe dans un répertoire temporaire.- Extraire l'extension puis excecuter l'applie qui va bien.- Attendre la fin de l'execution de l'applie (que l'utilisateur fasse sa modif.).- Attacher la nouvelle version de la piece jointe à la place de l'ancienne.Le plus gros soucis est de mettre notes en standby pendant que word est lancé par exemple.Pour cela j'ai une petite fonction si ça peut t'aider, elle utilise l'API windows :CODE A METTRE DANS LES DECLARATIONS :--------------------------------------------------------Type STARTUPINFO cb As Long lpReserved As String lpDesktop As String lpTitle As String dwX As Long dwY As Long dwXSize As Long dwYSize As Long dwXCountChars As Long dwYCountChars As Long dwFillAttribute As Long dwFlags As Long wShowWindow As Integer cbReserved2 As Integer lpReserved2 As Long hStdInput As Long hStdOutput As Long hStdError As LongEnd TypeType PROCESS_INFORMATION hProcess As Long hThread As Long dwProcessID As Long dwThreadID As LongEnd TypeDeclare Function WaitForSingleObject Lib "kernel32" (Byval hHandle As Long, Byval dwMilliseconds As Long) As LongDeclare Function CreateProcessA Lib "kernel32" (Byval lpApplicationName As Long, Byval lpCommandLine As String, Byval lpProcessAttributes As Long, Byval lpThreadAttributes As Long, Byval bInheritHandles As Long, Byval dwCreationFlags As Long, Byval lpEnvironment As Long, Byval lpCurrentDirectory As Long, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As LongDeclare Function CloseHandle Lib "kernel32" (Byval hObject As Long) As LongConst NORMAL_PRIORITY_CLASS = &H20&Const INFINITE = -1&CODE DE LA FONCTION (ajoute ta gestion d'erreur):-----------------------------------------------------------------Sub ShellAndWait(strProgName As String)'-----------------------------------------------------------------------------------' Description : Lance l'application passée en paramètre et attend la fin de son exécution'' Paramètres Entrée' - strProgName : le nom et chemin d'accès du programme à éxécuter'----------------------------------------------------------------------------------- Dim RetVal As Long Dim proc As PROCESS_INFORMATION Dim StartInf As STARTUPINFO RetVal = CreateProcessA(0&, strProgName, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, 0&, StartInf, proc) ' Attend la fin de l'éxécution du programme passé en paramètre RetVal = WaitForSingleObject(proc.hProcess, INFINITE) RetVal = CloseHandle(proc.hProcess) End Sub[%sig%]