Information générale
Catégorie:
Contrôles ActiveX en VFP
Hi all,
I'm using a MAPI Mail Activex Control (OLESession and OLEMessage) to send .txt files attached, When I made the form (workin VFP6 with Windows Me) it worked OK with 2 files or more, but when I execute the form in Windows 95/98 it allows add only one file.
Actually I´m sending one message for each file. How can I send many files in one message
Actually I'm using the following code :
WITH THISFORM
** It Creates a New message
.oleMessage.Compose
** I have a memo field with the addresses separated with (;)
** Here I add each address to an RecipAddress
direccion = alltrim(email_ant)
indice = 0 &&Index to control RecipIndex
do while !empty(direccion)
pos = atc(';',direccion)
if pos = 0
temp = alltrim(direccion)
direccion = ''
else
temp = substr(direccion,1,pos-1)
direccion = substr(direccion,pos+1,len(direccion))
Endif
.oleMessage.RecipIndex = indice
.oleMessage.RecipAddress = ALLTRIM(temp)
.oleMessage.RecipDisplayName = ALLTRIM(temp)
.oleMessage.ResolveName
indice = indice + 1
Enddo
** I Add the .txt file names to an Array (ATTACH)
a=adir(Attach,fullpath('')+'temp\*.txt')
for i = 1 to alen(Attach,1)
plano = alltrim(addbs(fullpath(''))+'temp\'+Attach(i,1))
** for each file add an AttachmentIndex and put
** AttachmentPathname = file name
.oleMessage.AttachmentIndex = 0
.oleMessage.AttachmentPathname = plano
** I put SUBJECT and TEXT of message
.oleMessage.MsgSubject = alltrim(ThisForm.txtSubject.value)+'. '+justfname(plano)
.oleMessage.MsgNoteText = alltrim(ThisForm.edtNoteText.value)
** SEND the Message
** When exists only one file it works OK, but when the array (ATTACH)
** contains more than one file it don´t work
.oleMessage.Send(0)
endfor
ENDWITH
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement