Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find Folder, Remove contacts and import contacts from Ex
Message
De
17/12/2009 17:31:31
Scott Sherman
Puyallup Tribal Health Authority
Tacoma, Washington, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01439064
Message ID:
01439677
Vues:
33
I am having an intermittent problem with "myItem.Delete()" below. Sometimes it works great and sometimes I get an OLE error "Parameter not optional". Same computer each time. Have any idea what would cause this?

myOlApp = CREATEOBJECT("Outlook.Application")
nms = myOlApp.GetNamespace("MAPI")
myFolder = nms.GetDefaultFolder(10)

lcFolderName = "text weather"
llFolderExists = .F.
FOR EACH loFolder IN myFolder.Folders
IF loFolder.NAME = lcFolderName
llFolderExists = .T.
lcTWfolder = loFolder
EXIT
ENDIF
ENDFOR

IF NOT llFolderExists
lcTWfolder = myFolder.Folders.ADD("text weather")
ENDIF

fldContacts = lcTWfolder.Items
myItems = fldContacts.RESTRICT("[CompanyName] = 'Texting'")
FOR i=myItems.COUNT TO 1 STEP -1
myItem = myItems.ITEM(i)
IF (myItem.CLASS = 40)
myItem.Delete()
ENDIF
ENDFOR
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform