Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
Email resolve problem
If there is a bad email address, is it possible to delete the email address after it has being added to the receipt list.
I’m assuming one has to add it (.Recipients.Add) in order for the resolve to work.
See code below.
Thanks
Anthony
Local loApplication, llActive, loMapiSpace, loInbox, loNew, I , cAttachlemts
#Include office97.h
#include 'pda.h'
With THISFORM
If empty(.txtTo.value)
.txtTo.Setfocus
Messagebox("You must enter an email address", mb_iconstop, .caption)
Return
Endif
loApplication = CreateObject( "Outlook.Application" )
llActive = ( varType( loApplication ) = "O" )
If llActive
loMapiSpace = loApplication.GetNameSpace("MAPI")
loInbox = loMapiSpace.GetDefaultFolder(olFolderOutBox) &&6
loNew = loInbox.Items.Add(olMailItem)
With loNew
With thisform.listmgr1
.init()
.add_items(ALLTRIM(thisform.txtTo.value))
Local I
For I = 1 TO .itemcount
With loNew.Recipients.Add(thisform.listmgr1.array[1,i])
.Type = olTo
If Not .Resolve
Messagebox("Unable to resolve address.")
*****************************************************************************
This is were I would like to Delete the email address
*****************************************************************************
Endif
Endwith
Endfor
Endwith
.to = ALLTRIM(thisform.txtTo.VALUE)
.Subject = ALLTRIM(thisform.txtSubject.VALUE)
.Body = thisform.txtDetails.VALUE
.Importance = thisform.OpgImportance.value - 1
.readReceiptRequested = ThisForm.chkRetReceipt.value
If ThisForm.chkDialog.value = 1
.Display
Else
.Send()
Endif
Endwith
Endif
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