Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 16-02-2010
izia izia is offline
Registrado
 
Registrado: feb 2010
Posts: 8
Poder: 0
izia Va por buen camino
Drag and Drop con archivo adjunto de outlook

Hola!
Tengo un problema con delphi. Quiero poder subir ficheros adjuntos a emails de outlook arrastrándolos a un listbox para subirlos a una base de datos. He estado mirando drag and drop, pero no consigo que funcione con ficheros adjuntos en outlook.
He buscado por google pero no encuentro código para delphi, he encontrado en visualbasic. Pero no lo tengo muy claro para "traducirlo", y si se puede...
¿Álguien sabe hacerlo?

El código en visual es este, por si alguien si tiene idea de como hacerlo:
Cita:
Private Sub Form1_DragEnter(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles MyBase.DragEnter
e.Effect = DragDropEffects.Copy
End Sub

Private Sub Form1_DragDrop(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles MyBase.DragDrop

Dim memoryStream As System.IO.MemoryStream =
e.Data.GetData("FileGroupDescriptor")
'Sets the position within the current stream to the beginning of the
file name.
memoryStream.Seek(76, IO.SeekOrigin.Begin)

Dim fileName As Byte() = New Byte(256) {}
'return the file name in the fileName variable
memoryStream.Read(fileName, 0, 256)

Dim encoding As System.Text.Encoding = System.Text.Encoding.ASCII
'convert to byte arry to string
Dim strFileName As String = encoding.GetString(fileName)
'trim the strFileName to get the correct file name
strFileName = strFileName.TrimEnd("")

memoryStream = e.Data.GetData("FileContents")
'write the file content to a file under the same path of the exe file.
Dim fs As New IO.FileStream(strFileName, IO.FileMode.Create)
memoryStream.WriteTo(fs)
fs.Close()

End Sub
Y lo he sacado de:
##w#w#w#.devnewsgroups.#net/#group/microsoft.#public.dotnet.framework.windowsforms/topic46776.#aspx

sin las almohadillas
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Outlook Archivo Adjunto shoulder Seguridad 0 01-04-2009 14:51:30
Descargar archivo adjunto del outlook mcalmanovici Varios 11 07-02-2008 20:54:53
Drag and Drop... dvlt .NET 0 07-02-2008 09:42:59
Drag&Drop de un archivo a mi aplicacion... Ascii1457 Varios 6 15-10-2006 16:10:09
Outlook Drag and Drop fpenaranda Servers 1 17-08-2006 12:57:40


La franja horaria es GMT +2. Ahora son las 00:09:44.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi