Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MAPI Mail
Message
 
 
To
25/01/2002 09:48:41
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00610446
Message ID:
00610976
Views:
23
Soporte,

I'm pretty sure you have to increment .oleMessage.AttachmentIndex = 0 with each file. And properly set AttachmentCount.

>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
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform